-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
59 lines (57 loc) · 1.56 KB
/
Copy pathwebpack.config.js
File metadata and controls
59 lines (57 loc) · 1.56 KB
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
var path = require('path')
var webpack = require('webpack')
var BrowserSyncPlugin = require('browser-sync-webpack-plugin')
// Three webpack config
var three = path.join(__dirname, '/node_modules/three/build/three.js')
var arjs = path.join(__dirname, '/node_modules/ar.js/three.js/contribs/npm/build/ar.js')
module.exports = {
entry: {
app: [
'babel-polyfill',
path.resolve(__dirname, 'src/Game.js')
]
},
devtool: 'cheap-source-map',
output: {
pathinfo: true,
path: path.resolve(__dirname, 'dist'),
publicPath: './dist/',
filename: 'game.js'
},
watch: true,
plugins: [
new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'true'))
}),
new BrowserSyncPlugin({
host: process.env.IP || 'localhost',
port: process.env.PORT || 9000,
server: {
baseDir: ['./', './build']
}
})
],
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
include: path.join(__dirname, 'src')
}
,{ test: /three\.js/, use: ['expose-loader?THREE'] }
//,{ test: /ar\.js/, use: ['expose-loader?THREEx'] }
]
},
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
},
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"],
alias: {
three:three,
'ar.js':arjs
}
}
}