mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-11 04:07:34 +03:00
37 lines
821 B
TypeScript
37 lines
821 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: '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',
|
|
},
|
|
},
|
|
});
|