mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
parent
9ef5598fd5
commit
7f8ec4262d
@ -20,9 +20,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build:assets && npm run build:html",
|
||||
"build:assets": "webpack -p",
|
||||
"build:assets": "NODE_ENV=production webpack -p",
|
||||
"build:html": "cp public/*.* dist/.",
|
||||
"start": "webpack-dev-server --config webpack.config.js --hot --progress --colors --port 3000",
|
||||
"start": "NODE_ENV=development webpack-dev-server --config webpack.config.js --hot --progress --colors --port 3000",
|
||||
"start:api": "json-server --watch mock-api.json -p 3001",
|
||||
"lint": "eslint . --ext=js,jsx",
|
||||
"test": "echo 'no test'",
|
||||
|
@ -5,12 +5,24 @@ const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
const entry = ['./src/index'];
|
||||
const plugins = [new ExtractTextPlugin('bundle.css', { allChunks: true })];
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
entry.push('webpack-dev-server/client?http://localhost:3000');
|
||||
entry.push('webpack/hot/only-dev-server');
|
||||
plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||
} else {
|
||||
plugins.push(new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify('production'),
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
entry: [
|
||||
'webpack-dev-server/client?http://localhost:3000',
|
||||
'webpack/hot/only-dev-server',
|
||||
'./src/index',
|
||||
],
|
||||
entry,
|
||||
|
||||
resolve: {
|
||||
root: [path.join(__dirname, 'src')],
|
||||
@ -39,10 +51,7 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new ExtractTextPlugin('bundle.css', { allChunks: true }),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
],
|
||||
plugins,
|
||||
|
||||
sassLoader: {
|
||||
data: '@import "theme/_config.scss";',
|
||||
@ -57,27 +66,7 @@ module.exports = {
|
||||
|
||||
devServer: {
|
||||
proxy: {
|
||||
'/features': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
'/strategies': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
'/archive': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
'/events': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
'/metrics': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
'/client': {
|
||||
'/api': {
|
||||
target: 'http://localhost:4242',
|
||||
secure: false,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user