node.js - How to add wildcard mapping in entry of webpack -
i need webpack js file in script folder.i tried
module.exports = { module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loaders: ["babel-loader"], } ], }, entry: "./src/scripts/*.js", output: { path: './src/build', filename: '[name].js' } }; i getting error this,
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) it not searching js file instead searching *.js that.help me out missed
the entry value should resolve specific file, or list of specific files.
from webpack docs:
if pass string: string resolved module loaded upon startup.
if pass array: modules loaded upon startup. last 1 exported.
if trying define 1 module, edit entry value point main application file , require other modules that.
if want bundle files directory, see arseniews answer
Comments
Post a Comment