redux-devtools/packages/map2tree/webpack.config.umd.ts

28 lines
639 B
TypeScript
Raw Normal View History

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