-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
46 lines (43 loc) · 1.02 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
const { CheckerPlugin } = require('awesome-typescript-loader');
var webpack = require('webpack');
var path = require( 'path' );
// Production build?
var IS_PROD = (process.env.NODE_ENV === 'production');
// Setup plugins
var PLUGINS = [ new CheckerPlugin() ];
// Main build config
module.exports = {
entry: './src/typescript/index.ts',
mode: IS_PROD ? 'production' : 'development',
optimization: {
minimize: IS_PROD
},
output: {
filename: IS_PROD ? './webgl/bundle.min.js' : './webgl/bundle.js'
},
resolve: {
// List of extensions to be tried when looking at imports
extensions: [
'.js',
'.ts',
'.tsx',
'.web.js',
'.webpack.js',
],
// Where to look for modules
modules: [
path.resolve( __dirname, 'src' ),
'node_modules'
],
},
module: {
rules: [
{
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
test: /\.tsx?$/,
use: [ 'awesome-typescript-loader' ]
}
]
},
plugins: PLUGINS
}