6
6
SymlinkCreator
7
7
} = require ( "@cocreate/webpack" ) ;
8
8
9
- const { CleanWebpackPlugin } = require ( "clean-webpack-plugin" ) ;
10
9
const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
11
- const CssMinimizerPlugin = require ( "css-minimizer-webpack-plugin" ) ;
10
+
12
11
const { EsbuildPlugin } = require ( "esbuild-loader" ) ;
13
12
14
13
module . exports = async ( env , argv ) => {
@@ -23,9 +22,8 @@ module.exports = async (env, argv) => {
23
22
filename : isProduction ? "[name].js" : "[name].js" ,
24
23
chunkFilename : isProduction ? "[name].js" : "[name].js" ,
25
24
library : "CoCreate" , // The name of your library globally
26
- libraryExport : "default" // Exports the default export of your entry point
27
- // libraryTarget: "umd",
28
- // globalObject: "this" // Important for UMD compatibility
25
+ libraryExport : "default" , // Exports the default export of your entry point
26
+ clean : true
29
27
} ,
30
28
31
29
experiments : {
@@ -39,7 +37,6 @@ module.exports = async (env, argv) => {
39
37
new ModuleGenerator ( CoCreateConfig . modules ) ,
40
38
new FileUploader ( env , argv ) ,
41
39
new SymlinkCreator ( ) ,
42
- new CleanWebpackPlugin ( ) ,
43
40
new MiniCssExtractPlugin ( {
44
41
filename : isProduction ? "[name].min.css" : "[name].css" ,
45
42
chunkFilename : ( pathData ) => {
@@ -105,10 +102,9 @@ module.exports = async (env, argv) => {
105
102
minimize : isProduction ,
106
103
minimizer : [
107
104
new EsbuildPlugin ( {
108
- target : "es2017" // Match the loader target
109
- // css: true // Optional: uncomment to let esbuild try minifying CSS
110
- } ) ,
111
- new CssMinimizerPlugin ( )
105
+ target : "es2017" , // Match the loader target
106
+ css : true
107
+ } )
112
108
] ,
113
109
114
110
splitChunks : {
0 commit comments