Files
react-jsonschema-form/webpack.config.dist.js
Ashwin Ramaswami b36d9d225c Use monaco for playground (#1374)
* feat: use monaco for playground

* fix: don't automatically indent code added to playground

* fix: automatic resizing
2019-07-30 20:23:57 +02:00

58 lines
1.2 KiB
JavaScript

var path = require("path");
var webpack = require("webpack");
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
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 MonacoWebpackPlugin({
languages: ['json']
}),
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"),
],
},
]
}
};