AngularJS-无效的配置对象。已使用与API模式不匹配的配置对象初始化了Webpack

时间:2020-09-29 20:45:44

标签: angularjs webpack

当尝试捆绑一些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不太熟悉。

0 个答案:

没有答案