Skip to content

Commit b0157e8

Browse files
authored
refactor: add types to webpack config files (#1256)
1 parent bc5c1ca commit b0157e8

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

webpack.common.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
// @ts-check
2+
13
const path = require('node:path');
24
const webpack = require('webpack');
35

4-
module.exports = {
6+
/**
7+
* @typedef {import('webpack').Configuration} WebpackConfig
8+
*/
9+
10+
/**
11+
* @type {WebpackConfig}
12+
*/
13+
const config = {
514
mode: 'development',
615
entry: './src/index.tsx',
716
devtool: 'inline-source-map',
@@ -34,3 +43,5 @@ module.exports = {
3443
path: path.resolve(__dirname, 'build', 'js'),
3544
},
3645
};
46+
47+
module.exports = config;

webpack.prod.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
// @ts-check
2+
13
const { merge } = require('webpack-merge');
24
const common = require('./webpack.common.js');
35

4-
module.exports = merge(common, {
6+
/**
7+
* @typedef {import('webpack').Configuration} WebpackConfig
8+
*/
9+
10+
/**
11+
* @type {WebpackConfig}
12+
*/
13+
const config = merge(common, {
514
mode: 'production',
615
devtool: 'source-map',
716
});
17+
18+
module.exports = config;

0 commit comments

Comments
 (0)