-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.common.ts
45 lines (43 loc) · 1.23 KB
/
webpack.common.ts
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
import webpack from 'webpack'
import PnpWebpackPlugin from 'pnp-webpack-plugin'
const config: webpack.Configuration = {
context: __dirname, // to automatically find tsconfig.json
entry: {
main: './src/index.ts',
/* vendor: './src/vendor.ts', */
},
// plugins: {
// // handle type checking whilst ts-loader gets on with the transpilation
// new ForkTsCheckerWebpackPlugin(PnpWebpackPlugin.forkTsCheckerOptions({
// useTypescriptIncrementalApi: false, // not possible to use this until: https://github.com/microsoft/TypeScript/issues/31056
// })),
// },
module: {
rules: [
{
test: /\.html$/,
use: ['html-loader'],
},
{
test: /\.ts?$/,
loader: require.resolve('ts-loader'),
options: PnpWebpackPlugin.tsLoaderOptions(),
// options: PnpWebpackPlugin.tsLoaderOptions({ transpileOnly: true }),
},
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
},
],
},
resolve: {
plugins: [PnpWebpackPlugin],
extensions: ['.ts', '.js', '.json', 'css', '.scss'],
},
resolveLoader: {
plugins: [PnpWebpackPlugin.moduleLoader(module)],
},
stats: { children: false },
}
export default config