forked from dragonman225/jade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.web.dev.js
61 lines (59 loc) · 1.58 KB
/
webpack.config.web.dev.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
const path = require('path')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const {
getCommonPlugins,
getModuleConfig,
getResolveConfig,
getOptimizationConfig,
} = require('./webpack.config.utils')
module.exports = {
/**
* @see https://webpack.js.org/configuration/target/
* Defaults to 'browserslist' or to 'web' when no browserslist
* configuration was found.
*/
// target: 'web',
context: process.cwd(), // to automatically find tsconfig.json
entry: {
app: './src/platforms/web/startup.ts',
},
output: {
path: path.resolve(__dirname, 'build/web'),
filename: '[name].js',
publicPath: '/',
},
plugins: getCommonPlugins().concat([
new ReactRefreshWebpackPlugin({ overlay: false }),
new ForkTsCheckerWebpackPlugin({
eslint: {
files: './src/**/*.{ts,tsx,js,jsx}',
},
}),
new HtmlWebpackPlugin({
inject: true,
template: 'src/index.html',
}),
]),
module: getModuleConfig('development'),
resolve: getResolveConfig(),
devtool: 'inline-source-map',
devServer: {
historyApiFallback: true,
client: {
/** Comment out this line to debug HMR issues. */
logging: 'info',
overlay: false,
},
devMiddleware: {
stats: 'errors-only',
},
/** Change to 'only' to debug HMR issues. */
hot: true,
liveReload: false,
host: '0.0.0.0',
port: 8140,
},
optimization: getOptimizationConfig(),
}