-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
71 lines (68 loc) · 1.7 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
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
mode: "production",
watch: false,
target: 'node-webkit',
entry: {
app: './app/index.js',
},
output: {
path: __dirname + '/build',
publicPath: 'build/',
filename: '[name].js',
// sourceMapFilename: '[name].js.map',
},
// Could not get these to work properly (Chrome appears to have a but at time
// of writing), but these are our source-map options:
// devtool: 'source-map',
// devtool: 'eval-source-map',
module: {
rules: [
{
test: /\.(js|ts|tsx)?$/,
loader: 'babel-loader',
options: {
compact: false,
presets: [
[
'@babel/preset-typescript', {
"isTSX": true,
"allExtensions": true,
}
],
'@babel/preset-react'
],
plugins: [ '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-optional-chaining' ]
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
loader: 'css-loader',
options: {
compact: false,
modules: true,
}
})
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
query: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
extensions: ['.js', '.ts', '.json', '.jsx', '.tsx']
},
stats: {
// Silence warnings which are actually false positives.
warningsFilter: [
'"export \'CannonDebugRenderer\' (imported as \'THREE\') was not found in \'three\'',
(warning) => false
]
}
};