1var path = require('path') 2var cssnext = require('postcss-cssnext') 3 4var entry = {} 5var start = 'a' 6var end = 'o' 7var count = end.charCodeAt(0) - start.charCodeAt(0) 8 9new Array(count + 1).fill(0) 10 .forEach((n, i) => { 11 var name = String.fromCharCode(i + start.charCodeAt(0)) 12 entry[name] = path.resolve(__dirname, 'spec', name + '.we?entry') 13 }) 14 15module.exports = { 16 entry: entry, 17 output: { 18 path: path.resolve(__dirname, 'actual'), 19 filename: '[name].js' 20 }, 21 devtool: 'source-map', 22 module: { 23 loaders: [ 24 { 25 test: /\.we(\?[^?]+)?$/, 26 loaders: [path.resolve(__dirname, '..', 'index.js')] 27 }, 28 { 29 test: /\.js/, 30 loaders: ['babel?presets[]=es2015'] 31 } 32 ] 33 }, 34 devtool: 'inline-source-map', 35 resolveLoader: { 36 modulesDirectories: ['./node_modules'] 37 }, 38 postcss: function() { 39 return [cssnext({ 40 browsers: ['last 1 version'] 41 })] 42 }, 43 weex: { 44 lang: { 45 cssnext: ['postcss'], 46 jade: ['jade-html'], 47 coffee: ['coffee'] 48 } 49 } 50} 51