-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackpack.config.js
47 lines (42 loc) · 996 Bytes
/
backpack.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
const path = require('path')
const ForkTSCheckerPlugin = require('fork-ts-checker-webpack-plugin')
module.exports = {
webpack: (config, options, webpack) => {
config.entry.main = ['./src/index.ts']
config.resolve = {
extensions: ['.ts', '.js', '.json'],
modules: [
path.resolve('./src'),
// path.resolve('./node_modules'),
]
}
config.module.rules.push({
test: /\.ts$/,
use: [
{
loader: 'cache-loader',
},
{
loader: 'thread-loader',
options: {
workers: require('os').cpus().length - 1,
poolTimeout: Infinity,
},
},
{
loader: 'ts-loader',
options: {
happyPackMode: true,
transpileOnly: true,
},
},
],
})
// config.plugins.push(
// new ForkTSCheckerPlugin({
// checkSyntacticErrors: true,
// }),
// )
return config
},
}