redux-devtools/packages/d3-state-visualizer/webpack.config.umd.ts

30 lines
684 B
TypeScript
Raw Permalink Normal View History

import * as path from 'path';
2021-12-05 06:28:45 +03:00
import * as webpack from 'webpack';
2021-12-05 06:28:45 +03:00
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],
},
output: {
library: 'd3-state-visualizer',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'dist'),
filename: env.production
? 'd3-state-visualizer.min.js'
: 'd3-state-visualizer.js',
},
module: {
rules: [
{
test: /\.(js|ts)$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
});