This commit is contained in:
Nathan Bierema 2020-10-25 17:45:02 -04:00
parent d3aa75aeaa
commit d6d82ada10
2 changed files with 16 additions and 7 deletions

View File

@ -25,8 +25,8 @@
"build:types": "tsc --emitDeclarationOnly",
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
"build:web": "rimraf ./build/web && webpack -p --env.platform=web --progress",
"build:umd": "rimraf ./umd && webpack --progress --config webpack.config.umd.js",
"build:umd:min": "webpack --env.production --progress --config webpack.config.umd.js",
"build:umd": "rimraf ./umd && webpack --progress --config webpack.config.umd.ts",
"build:umd:min": "webpack --env.production --progress --config webpack.config.umd.ts",
"clean": "rimraf lib",
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",

View File

@ -1,10 +1,11 @@
const path = require('path');
const webpack = require('webpack');
import * as path from 'path';
import * as webpack from 'webpack';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
module.exports = (env = {}) => ({
module.exports = (env: { production?: boolean } = {}) => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/app/index.js'],
app: ['./src/app/index'],
},
output: {
library: 'ReduxDevTools',
@ -18,7 +19,7 @@ module.exports = (env = {}) => ({
module: {
rules: [
{
test: /\.js$/,
test: /\.(js|ts)x?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
@ -41,6 +42,9 @@ module.exports = (env = {}) => ({
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
@ -48,6 +52,11 @@ module.exports = (env = {}) => ({
PLATFORM: JSON.stringify('web'),
},
}),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: 'tsconfig.json',
},
}),
],
externals: {
react: {