mirror of
https://github.com/zhigang1992/react-jsonschema-form.git
synced 2026-05-11 15:36:43 +08:00
fixes version conflicts, e.g. I got an error Uncaught TypeError: this.updater.enqueueCallback is not a function when using setState callback because I use React 16.x and react-jsonschema-form bundled react-dom 15.x See https://github.com/facebook/react/issues/10320#issuecomment-318754280
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
var path = require("path");
|
|
var webpack = require("webpack");
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
cache: true,
|
|
context: __dirname + "/src",
|
|
entry: "./index.js",
|
|
output: {
|
|
path: path.join(__dirname, "dist"),
|
|
publicPath: "/dist/",
|
|
filename: "react-jsonschema-form.js",
|
|
library: "JSONSchemaForm",
|
|
libraryTarget: "umd"
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
"process.env": {
|
|
NODE_ENV: JSON.stringify("production")
|
|
}
|
|
})
|
|
],
|
|
devtool: "source-map",
|
|
externals: {
|
|
react: {
|
|
root: "React",
|
|
commonjs: "react",
|
|
commonjs2: "react",
|
|
amd: "react"
|
|
},
|
|
'react-dom': {
|
|
root: "ReactDOM",
|
|
commonjs2: 'react-dom',
|
|
commonjs: 'react-dom',
|
|
amd: 'react-dom',
|
|
umd: 'react-dom',
|
|
}
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
use: [
|
|
"babel-loader",
|
|
],
|
|
exclude: [
|
|
path.join(__dirname, "node_modules", "core-js"),
|
|
path.join(__dirname, "node_modules", "babel-runtime"),
|
|
],
|
|
},
|
|
]
|
|
}
|
|
};
|