vue-to-wepy-webpack-plugin

1.2.2 • Public • Published

vue to wepy plugin

插件的主要作用是将vue的html组件,转化为wepy支持的组件。

比如一个目录如下的项目:

src
dist

这样调用插件的时候:

plugins:[
    new VueToWepyWebpackPlugin({
        sourcePath:path.join(__dirname,'./src'),
        distPath:path.join(__dirname,"./wepy-source"),
        watch:true
    })
]

插件会把src目录下的文件,按照原来的目录结构,实时编译到wepy-source目录,目前只编译.vue后缀里文件里的<template>内的内容。 //其实目前还没写完html tag to wepy tag的转换,目前就只是简单的把文件按照对应的结构给复制过去

webpack配置示例:

const path = require('path');
const VueToWepyWebpackPlugin = require('./vue-to-wepy-webpack-plugin');
const webpack = require('webpack'); //to access built-in plugins
const path = require('path');
const VueToWepyWebpackPlugin = require('./vue-to-wepy-webpack-plugin');
const config = {
entry: './src/index.js',
output: {
    path: path.resolve(__dirname, 'wepy-source'),
    filename: 'dist.bundle.js'
},
plugins:[
    new VueToWepyWebpackPlugin({
        sourcePath:path.join(__dirname,'./src'),
        distPath:path.join(__dirname,"./wepy-source"),
        watch:true
    })
]
};

module.exports = config;

Readme

Keywords

none

Package Sidebar

Install

npm i vue-to-wepy-webpack-plugin

Weekly Downloads

0

Version

1.2.2

License

ISC

Unpacked Size

65.1 kB

Total Files

17

Last publish

Collaborators

  • xiaomingplus