@@ -20,12 +20,19 @@ module.exports = async (env, argv) => {
20
20
path : path . resolve ( __dirname , 'dist' ) ,
21
21
filename : isProduction ? '[name].min.js' : '[name].js' ,
22
22
chunkFilename : isProduction ? '[name].min.js' : '[name].js' ,
23
+ // filename: isProduction ? '[name].js' : '[name].js',
24
+ // chunkFilename: isProduction ? '[name].js' : '[name].js',
23
25
libraryTarget : 'umd' ,
24
26
libraryExport : 'default' ,
25
27
library : 'CoCreate' ,
26
28
globalObject : "this" ,
27
29
} ,
28
30
31
+ experiments : {
32
+ asyncWebAssembly : true ,
33
+ topLevelAwait : true ,
34
+ } ,
35
+
29
36
plugins : [
30
37
new ModuleGenerator ( CoCreateConfig . modules ) ,
31
38
new FileUploader ( env , argv ) ,
@@ -50,43 +57,59 @@ module.exports = async (env, argv) => {
50
57
mode : isProduction ? 'production' : 'development' ,
51
58
52
59
// add source map
53
- ...( isProduction ? { devtool : 'eval-source-map' } : { devtool : 'eval-source-map' } ) ,
60
+ ...( isProduction ? { } : { devtool : 'eval-source-map' } ) ,
54
61
55
62
module : {
56
- rules : [ {
57
- test : / \. j s $ / ,
58
- use : [
59
- {
60
- loader : path . resolve ( __dirname , 'node_modules/@cocreate/webpack/src/replace-unicode.js' )
63
+ rules : [
64
+ {
65
+ test : / \. j s $ / ,
66
+ exclude : ( modulePath ) => {
67
+ // Additionally, exclude `CoCreate-ffmpeg.js` file
68
+ if ( / f f m p e g / . test ( modulePath ) ) {
69
+ return true ;
70
+ }
71
+ // Include all other .js files
72
+ return false ;
61
73
} ,
62
- {
63
- loader : 'babel-loader' ,
64
- options : {
65
- plugins : [ "@babel/plugin-transform-modules-commonjs" ] ,
66
- retainLines : true , // Add this option
74
+ use : [
75
+ {
76
+ loader : path . resolve ( __dirname , 'node_modules/@cocreate/webpack/src/replace-unicode.js' )
77
+ } ,
78
+ {
79
+ loader : 'babel-loader' ,
80
+ options : {
81
+ plugins : [ "@babel/plugin-transform-modules-commonjs" ] ,
82
+ retainLines : true , // Add this option
83
+ }
67
84
}
68
- }
69
- ]
70
- } ,
71
- {
72
- test : / .c s s $ / i,
73
- use : [
74
- MiniCssExtractPlugin . loader ,
75
- 'css-loader'
76
- ]
77
- } ,
78
- {
79
- test : / \. ( w o f f ( 2 ) ? | t t f | e o t | s v g ) ( \? v = \d + \. \d + \. \d + ) ? $ / ,
80
- use : [
81
- {
82
- loader : 'file-loader' ,
83
- options : {
84
- name : '[name].[ext]' ,
85
- outputPath : 'fonts/'
85
+ ]
86
+ } ,
87
+ {
88
+ test : / \. j s $ / ,
89
+ generator : {
90
+ filename : '[name].js' , // Customize this pattern
91
+ } ,
92
+ } ,
93
+ {
94
+ test : / .c s s $ / i,
95
+ use : [
96
+ MiniCssExtractPlugin . loader ,
97
+ 'css-loader'
98
+ ]
99
+ } ,
100
+ {
101
+ test : / \. ( w o f f ( 2 ) ? | t t f | e o t | s v g ) ( \? v = \d + \. \d + \. \d + ) ? $ / ,
102
+ use : [
103
+ {
104
+ loader : 'file-loader' ,
105
+ options : {
106
+ name : '[name].[ext]' ,
107
+ outputPath : 'fonts/'
108
+ }
86
109
}
87
- }
88
- ]
89
- } ]
110
+ ]
111
+ }
112
+ ]
90
113
} ,
91
114
92
115
optimization : {
0 commit comments