-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
45 lines (43 loc) · 1.04 KB
/
webpack.common.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
const path = require('path');
const buildPath = path.resolve(__dirname, 'dist');
const srcPath = path.resolve(__dirname, 'src');
module.exports = {
devtool: 'source-map',
entry: path.resolve(srcPath, 'index.ts'),
module: {
rules: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader',
exclude: /node_modules/,
},
],
},
output: {
filename: `webvoxel-plugin-wasdcontrols.min.js`,
path: buildPath,
library: 'Voxel',
libraryTarget: 'umd',
globalObject: 'this',
},
resolve: {
extensions: [
'.ts',
'.js',
],
},
externals: {
three: {
root: 'THREE',
commonjs: 'three',
commonjs2: 'three',
amd: 'three',
},
'@webvoxel/core': {
root: 'Voxel',
commonjs: '@webvoxel/core',
commonjs2: '@webvoxel/core',
amd: '@webvoxel/core',
},
},
};