当尝试捆绑一些AngularJS代码时,出现以下错误:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry['angular'] should be an non-empty array.
-> A non-empty array of non-empty strings
我的webpack.config.js文件如下:
const path = require('path');
var glob = require("glob");
module.exports = {
mode: "development",
module: {
rules: [
{
test: /\.js$/,
use: [{ loader: 'ng-annotate-loader' }]
}
]
},
entry: {
'angular': glob.sync("./AngularJS/!(Libraries)/!(angular.min|app|*.min|*.map).js")
},
output: {
filename: 'angular.bundle.js',
path: path.resolve('./dist')
}
};
我以前使用过此配置文件,但这是我继承的,因为我对Webpack不太熟悉。