-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
36 lines (28 loc) · 792 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
36 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const path =
require( "path" )
const distFolder =
path.resolve( __dirname, "out", "dist", )
const entryPoint = name =>
path.resolve( __dirname, "out", "compiled", "source", name )
const nodeConfiguration = {
mode: "production",
target: "node",
entry: entryPoint( "index.js" ),
output: {
libraryTarget: "commonjs",
path: distFolder,
filename: "textgraphic.node.js",
},
}
const webConfiguration = {
mode: "production",
target: "web",
entry: entryPoint( "web-index.js" ),
output: {
libraryTarget: "window",
path: distFolder,
filename: "textgraphic.web.js",
},
}
module.exports =
[ nodeConfiguration, webConfiguration ]