2 |
3 |
4 | Hello {{target}}
5 |
6 |
7 |
8 |
13 |
14 |
28 |
--------------------------------------------------------------------------------
/template/webpack.config.js:
--------------------------------------------------------------------------------
1 | // You can install more packages below to config more as you like:
2 | // eslint
3 | // babel-eslint
4 | // eslint-config-standard
5 | // eslint-loader
6 | // eslint-plugin-html
7 | // eslint-plugin-promise
8 | // eslint-plugin-standard
9 | // postcss-cssnext
10 |
11 | var path = require('path')
12 | var webpack = require('webpack')
13 |
14 | var bannerPlugin = new webpack.BannerPlugin(
15 | '// { "framework": "Vue" }\n',
16 | { raw: true }
17 | )
18 |
19 | function getBaseConfig () {
20 | return {
21 | entry: {
22 | app: path.resolve('./app.js')
23 | },
24 | output: {
25 | path: 'dist',
26 | },
27 | module: {
28 | // // You can use ESLint now!
29 | // // Please:
30 | // // 1. npm install {
31 | // // babel-eslint
32 | // // eslint
33 | // // eslint-config-standard
34 | // // eslint-loader
35 | // // eslint-plugin-html
36 | // // eslint-plugin-promise
37 | // // } --save-dev
38 | // // 2. set .eslintrc
39 | // // take { "extends": "standard" } for example
40 | // // so you need: npm install eslint-plugin-standard --save-dev
41 | // // 3. set the config below
42 | // preLoaders: [
43 | // {
44 | // test: /\.vue$/,
45 | // loader: 'eslint',
46 | // exclude: /node_modules/
47 | // },
48 | // {
49 | // test: /\.js$/,
50 | // loader: 'eslint',
51 | // exclude: /node_modules/
52 | // }
53 | // ],
54 | loaders: [
55 | {
56 | test: /\.js$/,
57 | loader: 'babel',
58 | exclude: /node_modules/
59 | }, {
60 | test: /\.vue(\?[^?]+)?$/,
61 | loaders: []
62 | }
63 | ]
64 | },
65 | vue: {
66 | // // You can use PostCSS now!
67 | // // Take cssnext for example:
68 | // // 1. npm install postcss-cssnext --save-dev
69 | // // 2. write `var cssnext = require('postcss-cssnext')` at the top
70 | // // 3. set the config below
71 | // postcss: [cssnext({
72 | // features: {
73 | // autoprefixer: false
74 | // }
75 | // })]
76 | },
77 | plugins: [bannerPlugin]
78 | }
79 | }
80 |
81 | var webConfig = getBaseConfig()
82 | webConfig.output.filename = '[name].web.js'
83 | webConfig.module.loaders[1].loaders.push('vue')
84 |
85 | var weexConfig = getBaseConfig()
86 | weexConfig.output.filename = '[name].weex.js'
87 | weexConfig.module.loaders[1].loaders.push('weex')
88 |
89 | module.exports = [webConfig, weexConfig]
90 |
--------------------------------------------------------------------------------
/template/weex.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |