-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
48 lines (47 loc) · 1.28 KB
/
webpack.config.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
const path = require("path");
module.exports = {
entry: "./src/index.js",
output: {
libraryTarget: "umd",
path: path.resolve(__dirname, "dist"),
publicPath: process.env.NODE_ENV === "production" ? undefined : "/dist/",
filename: "gltf-model-plus.min.js",
},
externals: {
// Stubs out `import ... from 'three'` so it returns `import ... from window.THREE` effectively using THREE global variable that is defined by AFRAME.
three: "THREE",
},
devtool: "source-map",
mode: process.env.NODE_ENV === "production" ? "production" : "development",
devServer: {
port: process.env.PORT || 8080,
hot: false,
liveReload: true,
server: {
type: "https",
},
static: ["."],
},
performance: {
assetFilter: function (assetFilename) {
// Exclude specific assets from the performance checks
return !assetFilename.endsWith(".cube") && !assetFilename.endsWith(".map");
},
},
module: {
rules: [
{
test: /\.(jpg|png|cube)$/,
type: "asset/resource",
generator: {
filename: "assets/[hash][ext]",
},
},
],
},
resolve: {
alias: {
"@mozillareality/easing-functions": path.resolve(__dirname, 'node_modules/lib-hubs/packages/easing-functions/lib/esm/index')
}
}
};