-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackpack.config.js
42 lines (38 loc) · 957 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
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin")
const OpenBrowserPlugin = require("open-browser-webpack-plugin")
module.exports = {
webpack: (config, _options, _webpack) => {
config.resolve = {
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
}
/**
* Add type-checking into Webpack pipeline
*/
config.plugins.push(
new ForkTsCheckerWebpackPlugin({
formatter: "codeframe",
formatterOptions: "highlightCode",
tslint: false,
checkSyntacticErrors: true,
watch: ["./src"],
}),
new OpenBrowserPlugin({
url: `http://localhost:4000/graphql`,
delay: 3000,
})
)
/**
* Enable TypeScript support via babel
*/
config.module.rules.push({
test: /\.(j|t)sx?$/,
include: [/src/],
use: [
{
loader: "babel-loader",
},
],
})
return config
},
}