With Webpack, is it possible to generate CSS only, excluding the output.js?

前端 未结 4 967
春和景丽
春和景丽 2021-01-30 11:25

I\'m using Webpack with the extract-text-webpack-plugin.

In my project, I have some build scripts. One of the build scripts is supposed to bundle and minify CSS only. As

4条回答
  •  醉梦人生
    2021-01-30 11:49

    You can clean up your dist folder for any unwanted assets after the done is triggered. This can be easily achieved with the event-hooks-webpack-plugin

    //
    plugins: [
            new EventHooksPlugin({
                'done': () => {
                    // delete unwanted assets 
                }
            })
        ]
    

    Good Luck...

提交回复
热议问题