-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
59 lines (57 loc) · 1.95 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
const webpack = require('webpack');
const path = require('path');
const fs = require('fs');
const nodeExternals = require('webpack-node-externals');
module.exports = {
cache: true,
mode: 'development',
resolve: {
modules: [
'node_modules',
path.join(__dirname, 'node_modules')
],
extensions: ['.js', '.ts', '.jsx', '.tsx']
},
entry: __dirname + '/src/main/web/Main.tsx',
externals: [],
output: {
path: path.join(__dirname + '/target'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
enforce: 'pre',
loader: require.resolve('tslint-loader'),
query: {
formatter: 'stylish',
configFile: './tslint.json'
}
},
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
loader: require.resolve('ts-loader')
},
{test: /.html$/, use: 'raw-loader'},
{test: /\.json$/, use: 'json-loader'},
{test: /\.(s*)css$/, use: ['style-loader', 'css-loader', 'sass-loader']},
{test: /\.woff(\?.+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff'},
{test: /\.woff2(\?.+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff'},
{test: /\.ttf(\?.+)?$/, use: 'file-loader'},
{test: /\.eot(\?.+)?$/, use: 'file-loader'},
{test: /\.svg(\?.+)?$/, use: 'file-loader'},
{test: /\.png$/, use: 'url-loader?mimetype=image/png'},
{test: /\.gif$/, use: 'url-loader?mimetype=image/gif'},
{test: /\.(glsl|vs|fs)$/, loader: 'ts-shader-loader'},
]
},
plugins: [],
devtool: 'cheap-source-map',
performance: {
maxAssetSize: 1500000,
maxEntrypointSize: 1500000
}
};