I have a folder structure like following:
/js
/src
/main.js
/cases
/default.js
/case1.js
/case2.js
My goal is to concat all files in "cases" folder with the main.js.
Ex.
default.js + main.js > prefix.default.js
case1.js + main.js > prefix.case1.js
etc..
/js
/dist
prefix.default.js
prefix.case1.js
...
How can i accomplish this with webpack and still using the loaders (babel).
Current webpack config.
module.exports = {
entry: './resources/js/src/main.js',
output: {
path: path.resolve(__dirname, 'resources/js/dist'),
filename: 'name.js'
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env']
}
}
]
}
};
Thanks in advance