File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' )
2
+ const packageJson = require ( './package.json' )
3
+
4
+ // production config minimizes the code
5
+ const productionConfig = {
6
+ mode : 'production' ,
7
+
8
+ // application entry point
9
+ entry : './lib/index.js' ,
10
+
11
+ // Output configuration
12
+ output : {
13
+ path : path . resolve ( __dirname , 'lib' ) ,
14
+ filename : `sqlitecloud.v${ packageJson . version } .js` ,
15
+ library : 'sqlitecloud' ,
16
+ libraryTarget : 'umd' ,
17
+ globalObject : 'this'
18
+ } ,
19
+
20
+ optimization : {
21
+ minimize : true
22
+ } ,
23
+
24
+ // add mock 'tls' module
25
+ resolve : {
26
+ fallback : {
27
+ tls : false // tell Webpack to ignore "tls"
28
+ }
29
+ }
30
+ }
31
+
32
+ // development config does not minimize the code
33
+ const devConfig = JSON . parse ( JSON . stringify ( productionConfig ) )
34
+ devConfig . mode = 'development'
35
+ devConfig . optimization . minimize = false
36
+ devConfig . output . filename = `sqlitecloud.v${ packageJson . version } .dev.js`
37
+
38
+ module . exports = [ productionConfig , devConfig ]
You can’t perform that action at this time.
0 commit comments