-
Notifications
You must be signed in to change notification settings - Fork 26
/
webpack.config.js
39 lines (37 loc) · 971 Bytes
/
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
const path = require('path');
const PLUGINS = [];
module.exports = {
devServer: {
static: __dirname,
host: '0.0.0.0'
},
entry: './index.js',
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
output: {
globalObject: 'this',
path: path.join(__dirname, 'dist'),
filename: process.env.NODE_ENV === 'production' ? 'aframe-loader-3dtiles-component.min.js' : 'aframe-loader-3dtiles-component.js',
publicPath: '/dist',
libraryTarget: 'umd'
},
plugins: PLUGINS,
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: ['babel-loader']
}
]
},
resolve: {
extensions: ['.js'],
modules: [path.join(__dirname, 'node_modules')]
},
externals: {
three: 'THREE',
'three/examples/jsm/loaders/GLTFLoader.js': 'THREE',
'three/examples/jsm/loaders/DRACOLoader.js': 'THREE',
'three/examples/jsm/loaders/KTX2Loader.js': 'THREE'
}
};