1- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
1+ const HtmlBundlerPlugin = require ( 'html-bundler -webpack-plugin' ) ;
22const path = require ( 'node:path' ) ;
3- const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
4- const RemoveEmptyScriptsPlugin = require ( 'webpack-remove-empty-scripts' ) ;
53
64module . exports = {
75 mode : 'development' ,
8- entry : {
9- index : path . join ( __dirname , 'examples/src/index.jsx' ) ,
10- style : path . join ( __dirname , 'examples/src/scss/style.scss' ) ,
11- } ,
126 output : {
137 path : path . join ( __dirname , 'examples/dist' ) ,
14- filename : '[name].js' ,
158 library : {
169 name : 'ReactCheckboxTree' ,
1710 type : 'umd' ,
@@ -33,7 +26,6 @@ module.exports = {
3326 {
3427 test : / \. s [ a c ] s s $ / i,
3528 use : [
36- MiniCssExtractPlugin . loader ,
3729 'css-loader' ,
3830 'sass-loader' ,
3931 ] ,
@@ -48,15 +40,16 @@ module.exports = {
4840 watchFiles : [ 'src/**/*' , 'examples/src/**/*' ] ,
4941 } ,
5042 plugins : [
51- new RemoveEmptyScriptsPlugin ( { } ) ,
52- new MiniCssExtractPlugin ( {
53- filename : '[name].css' ,
54- } ) ,
55- new HtmlWebpackPlugin ( {
56- template : 'examples/src/index.html' ,
57- filename : 'index.html' ,
58- inject : false ,
59- minify : false ,
60- } ) ,
43+ new HtmlBundlerPlugin ( {
44+ entry : {
45+ index : 'examples/src/index.html' ,
46+ } ,
47+ js : {
48+ filename : '[name].[contenthash:8].js' ,
49+ } ,
50+ css : {
51+ filename : '[name].[contenthash:8].css' ,
52+ }
53+ } ) ,
6154 ] ,
6255} ;
0 commit comments