diff --git a/packages/d3-state-visualizer/examples/tree/package.json b/packages/d3-state-visualizer/examples/tree/package.json index 98604111..96a2810e 100644 --- a/packages/d3-state-visualizer/examples/tree/package.json +++ b/packages/d3-state-visualizer/examples/tree/package.json @@ -2,9 +2,9 @@ "name": "d3-state-visualizer-tree-example", "version": "0.0.0", "description": "Visualize your app state as a tree", - "main": "server.js", + "main": "index.js", "scripts": { - "start": "node server.js" + "start": "webpack-dev-server --open" }, "repository": { "type": "git", diff --git a/packages/d3-state-visualizer/examples/tree/server.js b/packages/d3-state-visualizer/examples/tree/server.js deleted file mode 100644 index 3fced435..00000000 --- a/packages/d3-state-visualizer/examples/tree/server.js +++ /dev/null @@ -1,20 +0,0 @@ -var webpack = require('webpack'); -var WebpackDevServer = require('webpack-dev-server'); -var config = require('./webpack.config'); - -new WebpackDevServer(webpack(config), { - publicPath: config.output.publicPath, - hot: true, - historyApiFallback: true, - stats: { - colors: true, - }, -}).listen(3000, 'localhost', function (err) { - if (err) { - // eslint-disable-next-line no-console - console.log(err); - } - - // eslint-disable-next-line no-console - console.log('Listening at localhost:3000'); -}); diff --git a/packages/d3-state-visualizer/examples/tree/webpack.config.js b/packages/d3-state-visualizer/examples/tree/webpack.config.js index ae7a6613..9c710375 100644 --- a/packages/d3-state-visualizer/examples/tree/webpack.config.js +++ b/packages/d3-state-visualizer/examples/tree/webpack.config.js @@ -28,4 +28,9 @@ module.exports = { }, ], }, + devServer: { + historyApiFallback: true, + hot: true, + port: 3000, + }, }; diff --git a/packages/d3-state-visualizer/webpack.config.base.js b/packages/d3-state-visualizer/webpack.config.base.js index 1c584203..f7ac921b 100644 --- a/packages/d3-state-visualizer/webpack.config.base.js +++ b/packages/d3-state-visualizer/webpack.config.base.js @@ -8,6 +8,7 @@ module.exports = { }, output: { library: 'd3-state-visualizer', + libraryExport: 'default', libraryTarget: 'umd', }, resolve: { diff --git a/packages/d3tooltip/package.json b/packages/d3tooltip/package.json index e503ea29..64723bcb 100644 --- a/packages/d3tooltip/package.json +++ b/packages/d3tooltip/package.json @@ -7,7 +7,7 @@ "clean": "rimraf lib dist", "build": "babel src --out-dir lib", "build:umd": "webpack --progress --config webpack.config.umd.js", - "build:umd:min": "webpack --env.minimize --progress --config webpack.config.umd.js", + "build:umd:min": "webpack --env.production --progress --config webpack.config.umd.js", "version": "npm run build", "postversion": "git push && git push --tags && npm run clean", "prepare": "npm run clean && npm run build", diff --git a/packages/d3tooltip/webpack.config.umd.js b/packages/d3tooltip/webpack.config.umd.js index 6147c6fe..37a3178a 100644 --- a/packages/d3tooltip/webpack.config.umd.js +++ b/packages/d3tooltip/webpack.config.umd.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = (env = {}) => ({ - mode: 'production', + mode: env.production ? 'production' : 'development', entry: { app: ['./src/index.js'], }, @@ -9,7 +9,7 @@ module.exports = (env = {}) => ({ library: 'd3tooltip', libraryTarget: 'umd', path: path.resolve(__dirname, 'dist'), - filename: env.minimize ? 'd3tooltip.min.js' : 'd3tooltip.js', + filename: env.production ? 'd3tooltip.min.js' : 'd3tooltip.js', }, module: { rules: [ @@ -20,10 +20,4 @@ module.exports = (env = {}) => ({ }, ], }, - optimization: { - minimize: !!env.minimize, - }, - performance: { - hints: false, - }, }); diff --git a/packages/map2tree/package.json b/packages/map2tree/package.json index 62570e1b..f0ba9664 100755 --- a/packages/map2tree/package.json +++ b/packages/map2tree/package.json @@ -7,7 +7,7 @@ "clean": "rimraf lib dist", "build": "babel src --out-dir lib", "build:umd": "webpack --progress --config webpack.config.umd.js", - "build:umd:min": "webpack --env.minimize --progress --config webpack.config.umd.js", + "build:umd:min": "webpack --env.production --progress --config webpack.config.umd.js", "test": "jest", "prepare": "npm run build && npm run build:umd", "prepublishOnly": "npm run test && npm run clean && npm run build && npm run build:umd && npm run build:umd:min" diff --git a/packages/map2tree/webpack.config.umd.js b/packages/map2tree/webpack.config.umd.js index b137723e..fe011338 100644 --- a/packages/map2tree/webpack.config.umd.js +++ b/packages/map2tree/webpack.config.umd.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = (env = {}) => ({ - mode: 'production', + mode: env.production ? 'production' : 'development', entry: { app: ['./src/index.js'], }, @@ -9,7 +9,7 @@ module.exports = (env = {}) => ({ library: 'd3tooltip', libraryTarget: 'umd', path: path.resolve(__dirname, 'dist'), - filename: env.minimize ? 'map2tree.min.js' : 'map2tree.js', + filename: env.production ? 'map2tree.min.js' : 'map2tree.js', }, module: { rules: [ @@ -20,10 +20,4 @@ module.exports = (env = {}) => ({ }, ], }, - optimization: { - minimize: !!env.minimize, - }, - performance: { - hints: false, - }, }); diff --git a/packages/react-json-tree/examples/package.json b/packages/react-json-tree/examples/package.json index 93969f07..c2be4f29 100644 --- a/packages/react-json-tree/examples/package.json +++ b/packages/react-json-tree/examples/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "React-Json-Tree example", "scripts": { - "start": "node server.js", + "start": "webpack-dev-server --open", "stats": "NODE_ENV=production webpack --json > dist/stats.json" }, "repository": { diff --git a/packages/react-json-tree/examples/server.js b/packages/react-json-tree/examples/server.js deleted file mode 100755 index 8bba29b1..00000000 --- a/packages/react-json-tree/examples/server.js +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable no-console */ -var webpack = require('webpack'); -var WebpackDevServer = require('webpack-dev-server'); -var config = require('./webpack.config'); - -new WebpackDevServer(webpack(config), { - publicPath: config.output.publicPath, - hot: true, - historyApiFallback: true, -}).listen(3000, 'localhost', function (err) { - if (err) { - console.log(err); - } - - console.log('Listening at localhost:3000'); -}); diff --git a/packages/react-json-tree/examples/webpack.config.js b/packages/react-json-tree/examples/webpack.config.js index 9b1bbb6d..9633b3d2 100755 --- a/packages/react-json-tree/examples/webpack.config.js +++ b/packages/react-json-tree/examples/webpack.config.js @@ -26,4 +26,9 @@ module.exports = { }, ], }, + devServer: { + historyApiFallback: true, + hot: true, + port: 3000, + }, }; diff --git a/packages/redux-devtools-core/webpack.config.js b/packages/redux-devtools-core/webpack.config.js index ac59640d..ed75e5f7 100644 --- a/packages/redux-devtools-core/webpack.config.js +++ b/packages/redux-devtools-core/webpack.config.js @@ -3,7 +3,7 @@ const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = (env = {}) => ({ - mode: 'development', + mode: env.development ? 'development' : 'production', entry: { app: './index.js', },