I am trying to include multiple paths into Webpack module rules. Initially it gave me error for ./src/bootstrap.js, So I included the same in rules, now it gives me error for ./src/App.js. When I try to include it in same way, it breaks badly and gives error for many other files.
Can some please tell me how can I include /node_modules/mfe-react/index.js and all files in src folder ?
module.exports = {
module: {
rules: [
{
test: /\.*?js$/,
exclude: /node_modules/,
include: ['/node_modules/mfe-react/index.js',
path(__dirname, "..", "src", "bootstrap.js")
],
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-react", "@babel/preset-env"],
plugins: ["@babel/plugin-transform-runtime"],
},
},
},
],
},
Error: ERROR in ./src/App.js 13:12 Module parse failed: Unexpected token (13:12) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders