filter-webpack-plugin
removes unwanted emitted assets from the output of webpack.
This is often needed when you have entry points which are not JavaScript files and processed by other plugins like extract-text-webpack-plugin
.
npm i filter-webpack-plugin -D
yarn add filter-webpack-plugin -D
const FilterPlugin = require('filter-webpack-plugin');
...
module.exports = {
...
entry: {
css: "./src/scss/main.scss"
},
...
plugins: [
new FilterPlugin({files:['css.js', 'css.js.map']}),
],
...
};
Check the full names and paths of the emitted files to know which files you have to filter.
Yes, but most of them are not as small as this one.
You can use globby
or any other glob solution for this.