redux-devtools/packages/react-json-tree/webpack.config.umd.ts
Nathan Bierema 40ac89aff9
feature(react-json-tree): convert react-json-tree to TypeScript (#601)
* eslint base

* stash

* setup

* stash

* stash

* Add jest.config.js

* caught
2020-08-21 20:13:24 -04:00

36 lines
764 B
TypeScript

import * as path from 'path';
module.exports = (env: { production?: boolean } = {}) => ({
mode: env.production ? 'production' : 'development',
entry: {
app: ['./src/index'],
},
output: {
library: 'ReactJsonTree',
libraryExport: 'default',
libraryTarget: 'umd',
path: path.resolve(__dirname, 'umd'),
filename: env.production ? 'react-json-tree.min.js' : 'react-json-tree.js',
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
},
});