-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
43 lines (34 loc) · 892 Bytes
/
webpack.config.ts
File metadata and controls
43 lines (34 loc) · 892 Bytes
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
const path = require('path');
async function getBaseConfig(): Promise<import('webpack').Configuration> {
const externalDependencies = ['@blakek/deep', 'glob', 'mkdirp'];
const externals = externalDependencies.reduce((externals, packageName) => {
return { ...externals, [packageName]: packageName };
}, {});
return {
entry: {
cli: './src/cli.ts',
index: './src/index.ts'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: `[name].js`,
library: { type: 'commonjs' },
clean: true
},
externals: externals,
module: {
rules: [
{
test: /\.[jt]sx?$/,
loader: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json', '.wasm']
},
target: 'node12'
};
}
module.exports = getBaseConfig();