forked from Quantumgames-inc/QuantumEngineStudio3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.runtime.js
57 lines (51 loc) · 962 Bytes
/
webpack.runtime.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const Path = require("path");
const Webpack = require("webpack");
const source = Path.resolve(__dirname, "source");
const output = Path.resolve(__dirname, "build/runtime");
const config = {
context: source,
entry: source + "/core/Main.js",
target: "web",
devtool: "none",
mode: "production",
optimization: {
minimize: true
},
plugins: [
new Webpack.ProvidePlugin({
THREE: "three",
"window.THREE": "three"
})
],
module: {
rules: [
{
test: /\.glsl$/i,
use: "raw-loader",
},
{
test: /.*spine-threejs.*/,
loader: "@shoutem/webpack-prepend-append",
query: "{\"append\": \"export {spine};\"}"
}
]
}
};
module.exports = [
Object.assign({
output: {
filename: "nunu.min.js",
path: output,
library: 'Nunu',
libraryTarget: 'umd'
}
}, config),
Object.assign({
output: {
filename: "nunu.module.min.js",
path: output,
libraryTarget: 'umd'
}
}, config),
];
libraryTarget: 'umd'