Skip to content

Commit

Permalink
refactor: add types to webpack config files (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored Jun 17, 2024
1 parent bc5c1ca commit b0157e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
// @ts-check

const path = require('node:path');
const webpack = require('webpack');

module.exports = {
/**
* @typedef {import('webpack').Configuration} WebpackConfig
*/

/**
* @type {WebpackConfig}
*/
const config = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'inline-source-map',
Expand Down Expand Up @@ -34,3 +43,5 @@ module.exports = {
path: path.resolve(__dirname, 'build', 'js'),
},
};

module.exports = config;
13 changes: 12 additions & 1 deletion webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// @ts-check

const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {
/**
* @typedef {import('webpack').Configuration} WebpackConfig
*/

/**
* @type {WebpackConfig}
*/
const config = merge(common, {
mode: 'production',
devtool: 'source-map',
});

module.exports = config;

0 comments on commit b0157e8

Please sign in to comment.