redux-devtools/packages/d3tooltip/webpack.config.umd.ts
2021-12-05 03:28:45 +00:00

28 lines
642 B
TypeScript

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