Type-check Webpack configs (#976)

This commit is contained in:
Nathan Bierema 2021-12-04 22:28:45 -05:00 committed by GitHub
parent 5a507de8cf
commit f60e636a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 48 additions and 15 deletions

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
export default {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.ts',
devtool: 'eval-source-map',
@ -41,3 +42,5 @@ export default {
extensions: ['.js', '.ts'],
},
};
export default config;

View File

@ -1,6 +1,7 @@
import * as path from 'path';
import * as webpack from 'webpack';
export default (env: { production?: boolean } = {}) => ({
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],

View File

@ -1,6 +1,7 @@
import * as path from 'path';
import * as webpack from 'webpack';
export default (env: { production?: boolean } = {}) => ({
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],

View File

@ -1,6 +1,7 @@
import * as path from 'path';
import * as webpack from 'webpack';
export default (env: { production?: boolean } = {}) => ({
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -42,3 +43,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -42,3 +43,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,6 +1,7 @@
import * as path from 'path';
import * as webpack from 'webpack';
module.exports = (env: { production?: boolean } = {}) => ({
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],

View File

@ -3,7 +3,9 @@ import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = (env: { development?: boolean; platform?: string } = {}) => ({
export default (
env: { development?: boolean; platform?: string } = {}
): webpack.Configuration => ({
mode: env.development ? 'development' : 'production',
entry: {
app: './demo/index',

View File

@ -2,7 +2,7 @@ import * as path from 'path';
import * as webpack from 'webpack';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = (env: { production?: boolean } = {}) => ({
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],

View File

@ -1,9 +1,10 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import pkg from '@redux-devtools/inspector-monitor-test-tab/package.json';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -48,3 +49,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,9 +1,10 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import pkg from '@redux-devtools/inspector-monitor/package.json';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -44,3 +45,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,10 +1,11 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import pkg from '@redux-devtools/rtk-query-monitor/package.json';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -58,3 +59,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -44,3 +45,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -42,3 +43,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;

View File

@ -1,8 +1,9 @@
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = {
const config: webpack.Configuration = {
mode: 'development',
entry: './src/index.tsx',
devtool: 'eval-source-map',
@ -46,3 +47,5 @@ module.exports = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};
export default config;