-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
53 lines (51 loc) · 1.2 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
"use strict";
const path = require('path');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: 'source-map',
entry: {
app: './src/app.ts'
},
resolve: {
extensions: [
'.ts', '.js',
],
},
output: {
path: path.resolve(__dirname, 'public/dist')
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'babel-loader?cacheDirectory',
exclude: /node_modules/,
},
],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
checkSyntacticErrors: true,
eslint: true,
tsconfig: path.resolve(__dirname, 'tsconfig.json')
}),
new BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static',
reportFilename: __dirname + '/storage/bundle-analyzer/' + process.env.NODE_ENV + '.html'
})
],
optimization: {
splitChunks: {
name: 'vendor',
chunks: 'initial',
}
},
devServer: {
contentBase: path.join(__dirname, "public"),
port: 3000,
publicPath: '/dist/'
}
};