//wabpack.config.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'eval-source-map',
entry: __dirname + "/app/main.js",
output: {
path: __dirname + "/build",
filename: "bundle.js"
},
module: {
loaders: [
{
test: /.json$/,
loader: "json-loader"
},
{
test: /.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /.css$/,
loader: 'style-loader!css-loader?modules!postcss'
}
]
},
postcss: [
require('autoprefixer')//调用autoprefixer插件
],
plugins:[
new HtmlWebpackPlugin({
template: __dirname + "/app/index.tmpl.html"
})//在这个数组中new一个就可以了
]
}
出现的错误
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…