Excludes files from output
npm i -D webpack-exclude-entry
const ExcludeEntry = require('webpack-exclude-entry');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const extractSass = new MiniCssExtractPlugin({
filename: './css/[name].css',
});
module.exports = (env, argv) => {
return {
entry: {
"style.min": [jsPath + 'style.js'],
"build.min": [jsPath + 'index.js'],
},
output: {
path: './dist/',
filename: 'js/[name].js',
},
plugins: [
extractSass,
new ExcludeEntry([/style\.min\.js/]), //do not save files
],
};
};
./dist/css/style.min.css
./dist/js/build.min.js