1
- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
1
+ const HtmlBundlerPlugin = require ( 'html-bundler -webpack-plugin' ) ;
2
2
const path = require ( 'node:path' ) ;
3
- const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
4
- const RemoveEmptyScriptsPlugin = require ( 'webpack-remove-empty-scripts' ) ;
5
3
6
4
module . exports = {
7
5
mode : 'development' ,
8
- entry : {
9
- index : path . join ( __dirname , 'examples/src/index.jsx' ) ,
10
- style : path . join ( __dirname , 'examples/src/scss/style.scss' ) ,
11
- } ,
12
6
output : {
13
7
path : path . join ( __dirname , 'examples/dist' ) ,
14
- filename : '[name].js' ,
15
8
library : {
16
9
name : 'ReactCheckboxTree' ,
17
10
type : 'umd' ,
@@ -33,7 +26,6 @@ module.exports = {
33
26
{
34
27
test : / \. s [ a c ] s s $ / i,
35
28
use : [
36
- MiniCssExtractPlugin . loader ,
37
29
'css-loader' ,
38
30
'sass-loader' ,
39
31
] ,
@@ -48,15 +40,16 @@ module.exports = {
48
40
watchFiles : [ 'src/**/*' , 'examples/src/**/*' ] ,
49
41
} ,
50
42
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
+ } ) ,
61
54
] ,
62
55
} ;
0 commit comments