mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-10 19:56:54 +03:00
chore(*): cleanup webpack configs (#577)
This commit is contained in:
parent
4ba5573803
commit
5ce9f42b2c
|
@ -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",
|
||||
|
|
|
@ -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');
|
||||
});
|
|
@ -28,4 +28,9 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
devServer: {
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
port: 3000,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@ module.exports = {
|
|||
},
|
||||
output: {
|
||||
library: 'd3-state-visualizer',
|
||||
libraryExport: 'default',
|
||||
libraryTarget: 'umd',
|
||||
},
|
||||
resolve: {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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": {
|
||||
|
|
16
packages/react-json-tree/examples/server.js
vendored
16
packages/react-json-tree/examples/server.js
vendored
|
@ -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');
|
||||
});
|
|
@ -26,4 +26,9 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
devServer: {
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
port: 3000,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user