-
Notifications
You must be signed in to change notification settings - Fork 1
/
TODO-delete
74 lines (73 loc) · 1.97 KB
/
TODO-delete
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
72
73
74
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const isProd = process.env.NODE_ENV === 'production'; // eslint-disable-line
const isAnalysis = process.env.NODE_ENV === 'analysis'; // eslint-disable-line
module.exports = {
plugins: [
new MonacoWebpackPlugin({
// available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
languages: ['json'],
features: ['!gotoSymbol'],
}),
isAnalysis ? new BundleAnalyzerPlugin() : false,
].filter(d => d),
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.ts', '.tsx', '.js'],
modules: ['node_modules'],
},
entry: {
app: './src/app.tsx',
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
},
],
},
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
exclude: [/node_modules/],
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {plugins: [require('autoprefixer')]},
},
],
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/],
query: {
presets: ['es2017'],
},
},
{
test: /\.md$/i,
use: 'raw-loader',
},
],
},
devServer: {
stats: {
children: false, // Hide children information
maxModules: 0, // Set the maximum number of modules to be shown
},
},
mode: isProd || isAnalysis ? 'production' : 'development',
devtool: isProd || isAnalysis ? 'source-map' : 'cheap-module-source-map',
};