1- import path from 'path' ;
2- import { fileURLToPath } from 'url' ;
1+ import path from 'node:path' ;
2+ import { fileURLToPath } from 'node:url' ;
3+ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin' ;
34import MiniCssExtractPlugin from 'mini-css-extract-plugin' ;
45import TerserJSPlugin from 'terser-webpack-plugin' ;
5- import CssMinimizerPlugin from 'css-minimizer-webpack-plugin' ;
66import ChunksWebpackPlugin from '../lib/index.js' ;
77
88const __filename = fileURLToPath ( import . meta. url ) ;
99const __dirname = path . dirname ( __filename ) ;
1010
11- export default ( env , argv ) => {
11+ export default ( _env , argv ) => {
1212 const isProduction = argv . mode === 'production' ;
1313
1414 return {
@@ -29,7 +29,7 @@ export default (env, argv) => {
2929 output : {
3030 path : path . resolve ( __dirname , './dist' ) ,
3131 publicPath : '/dist/' ,
32- filename : ` js/[name].js`
32+ filename : ' js/[name].js'
3333 } ,
3434 module : {
3535 rules : [
@@ -58,10 +58,8 @@ export default (env, argv) => {
5858 } ) ,
5959 new ChunksWebpackPlugin ( {
6060 filename : '/templates/[name]-[type].html' ,
61- templateStyle : ( name ) =>
62- `<link rel="stylesheet" href="https://cdn.domain.com${ name } " />` ,
63- templateScript : ( name ) =>
64- `<script defer src="https://cdn.domain.com${ name } "></script>` ,
61+ templateStyle : ( name ) => `<link rel="stylesheet" href="https://cdn.domain.com${ name } " />` ,
62+ templateScript : ( name ) => `<script defer src="https://cdn.domain.com${ name } "></script>` ,
6563 generateChunksManifest : true ,
6664 generateChunksFiles : true
6765 } )
0 commit comments