我试图用webpack最小化我的bundle.js文件,但是在我的配置中出现了错误:
module.exports = {
entry: "./entry.js",
output: {
devtoolLineToLine: true,
sourceMapFilename: "./bundle.js.map",
pathinfo: true,
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
})
]
};错误:
/Users/leongaban/Projects/TickerTags/ionic/TickerTags/www/webpack.config.js:16
new webpack.optimize.UglifyJsPlugin({
^
ReferenceError: webpack is not defined发布于 2015-12-04 19:59:40
似乎您在配置文件的顶部缺少了var webpack = require('webpack');。
它对我来说是这样的
https://stackoverflow.com/questions/34096049
复制相似问题