forked from iTowns/itowns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
71 lines (68 loc) · 1.69 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var path = require('path');
var webpack = require('webpack');
// THREE js replace
//"three": "^0.74.0" -> "three": "mrdoob/three.js#35a5994828da7cebc0d8442062f784b3f9e1f818",
// #idcommit
var definePlugin = new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.DEV_BUILD || 'false')),
});
module.exports = {
entry: [ 'es6-promise', 'whatwg-fetch', 'custom-event', path.resolve(__dirname, 'src/Main.js') ],
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'itowns2.js',
library: 'itowns2',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
preLoaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test')
],
loader: 'eslint'
}
],
loaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test')
],
loader: 'babel'
},
{
test: /\.glsl$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'test')
],
loader: 'raw'
},
{
test: /node_modules[\/\\]three[\/\\]examples[\/\\].*\.js$/,
loader: 'imports',
query: {
'THREE': 'three'
}
}
],
noParse: [
/js-priority-queue[\\\/]file\.js$/,
path.join(__dirname, "node_modules", "js-priority-queue")
]
},
resolve: {
root: path.resolve(__dirname, 'src'),
extensions: ['', '.js']
},
devServer: {
publicPath: '/dist/'
},
plugins: [definePlugin]
};