【发布时间】:2018-11-08 19:49:28
【问题描述】:
我正在尝试向我的 webpack.config 文件添加多个入口点,但我无法让它正常工作。我的想法基本上是:
var entryPoints = glob.sync('./Scripts/**.ts').reduce(function (obj, el) {
obj[path.parse(el).name] = el;
return obj
}, {});
entryPoints.push({
a: path.join(__dirname, 'Content/a.scss'),
b: path.join(__dirname, 'Content/b.scss'),}
);
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: entryPoints,
...
但这样做我只会得到一个“TypeError:entryPoints.push 不是函数”。
还有其他更好的方法来做我想做的事吗?为了回答另一个问题,我不希望包含 'content/**.scss' 中的所有文件,只包含其中的一小部分文件。
【问题讨论】:
标签: javascript webpack glob