我需要的条目添加通配符映射到的WebPack在脚本中的所有js文件folder.I试过这种如何的WebPack
module.exports = {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
}
],
},
entry: "./src/scripts/*.js",
output: {
path: './src/build',
filename: '[name].js'
}
};
我得到的错误是这样,
ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' ./s
rc/scripts/* in E:\Web project\ReactJS\react-tutorial
resolve file
E:\Web project\ReactJS\react-tutorial\src\scripts\* doesn't exist
E:\Web project\ReactJS\react-tutorial\src\scripts\*.webpack.js doesn't exist
E:\Web project\ReactJS\react-tutorial\src\scripts\*.web.js doesn't exist
E:\Web project\ReactJS\react-tutorial\src\scripts\*.js doesn't exist
E:\Web project\ReactJS\react-tutorial\src\scripts\*.json doesn't exist
resolve directory
E:\Web project\ReactJS\react-tutorial\src\scripts\* doesn't exist (directory d
efault file)
E:\Web project\ReactJS\react-tutorial\src\scripts\*\package.json doesn't exist
(directory description file)
它没有搜索所有的js文件,而是正在搜索* .js那样。帮我出去什么我错过了
通配符不会导致一个干净的解决方案。您始终可以有一个主文件来导入目录中的所有其他库并将它指向webpack条目。 – whatAboutJohn