//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一个就可以了
]
}
出现的错误

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
目测你用了webpack2 但是配置还是webpack1的 可以看看我的配置.
或者换回webpack1