mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
Merge pull request #140 from Unleash/webpack4
fix(webpack): Upgrade webpack to 4.x
This commit is contained in:
commit
a17440c1c2
@ -1,9 +1,8 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Unleash Admin</title>
|
<title>Unleash DEVMODE</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="/static/bundle.css" />
|
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
@ -42,14 +42,14 @@
|
|||||||
"debug": "^3.1.0",
|
"debug": "^3.1.0",
|
||||||
"immutable": "^3.8.1",
|
"immutable": "^3.8.1",
|
||||||
"normalize.css": "^8.0.0",
|
"normalize.css": "^8.0.0",
|
||||||
"prop-types": "^15.6.0",
|
"prop-types": "^15.6.2",
|
||||||
"react": "^16.4.2",
|
"react": "^16.4.2",
|
||||||
"react-dnd": "^5.0.0",
|
"react-dnd": "^5.0.0",
|
||||||
"react-dnd-html5-backend": "^5.0.1",
|
"react-dnd-html5-backend": "^5.0.1",
|
||||||
"react-dom": "^16.4.2",
|
"react-dom": "^16.4.2",
|
||||||
"react-mdl": "^1.11.0",
|
"react-mdl": "^1.11.0",
|
||||||
"react-modal": "^3.1.13",
|
"react-modal": "^3.1.13",
|
||||||
"react-redux": "^5.0.6",
|
"react-redux": "^5.0.7",
|
||||||
"react-router-dom": "^4.3.1",
|
"react-router-dom": "^4.3.1",
|
||||||
"redux": "^4.0.0",
|
"redux": "^4.0.0",
|
||||||
"redux-thunk": "^2.1.0",
|
"redux-thunk": "^2.1.0",
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.14.0",
|
"babel-core": "^6.14.0",
|
||||||
"babel-eslint": "^8.0.2",
|
"babel-eslint": "^8.0.2",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.5",
|
||||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||||
"babel-preset-es2015": "^6.14.0",
|
"babel-preset-es2015": "^6.14.0",
|
||||||
"babel-preset-react": "^6.11.1",
|
"babel-preset-react": "^6.11.1",
|
||||||
@ -73,20 +73,21 @@
|
|||||||
"eslint-config-finn-prettier": "^3.0.1",
|
"eslint-config-finn-prettier": "^3.0.1",
|
||||||
"eslint-config-finn-react": "^2.0.1",
|
"eslint-config-finn-react": "^2.0.1",
|
||||||
"eslint-plugin-react": "^7.10.0",
|
"eslint-plugin-react": "^7.10.0",
|
||||||
"extract-text-webpack-plugin": "^3.0.0",
|
|
||||||
"fetch-mock": "^6.0.0",
|
"fetch-mock": "^6.0.0",
|
||||||
"identity-obj-proxy": "^3.0.0",
|
"identity-obj-proxy": "^3.0.0",
|
||||||
"jest": "^23.5.0",
|
"jest": "^23.5.0",
|
||||||
|
"mini-css-extract-plugin": "^0.4.1",
|
||||||
"node-sass": "^4.5.3",
|
"node-sass": "^4.5.3",
|
||||||
"prettier": "^1.8.2",
|
"prettier": "^1.8.2",
|
||||||
"react-test-renderer": "^16.2.0",
|
"react-test-renderer": "^16.2.0",
|
||||||
"redux-devtools": "^3.3.1",
|
"redux-devtools": "^3.4.1",
|
||||||
"redux-mock-store": "^1.5.1",
|
"redux-mock-store": "^1.5.1",
|
||||||
"sass-loader": "^7.0.1",
|
"sass-loader": "^7.0.1",
|
||||||
"style-loader": "^0.22.0",
|
"style-loader": "^0.22.0",
|
||||||
"toolbox-loader": "0.0.3",
|
"toolbox-loader": "0.0.3",
|
||||||
"webpack": "^3.1.0",
|
"webpack": "^4.17.0",
|
||||||
"webpack-dev-server": "^2.6.1"
|
"webpack-cli": "^3.1.0",
|
||||||
|
"webpack-dev-server": "^3.1.5"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
|
@ -3,11 +3,16 @@
|
|||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
const devMode = process.env.NODE_ENV !== 'production';
|
||||||
|
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
||||||
const entry = ['whatwg-fetch', './src/index'];
|
const entry = ['whatwg-fetch', './src/index'];
|
||||||
const plugins = [
|
const plugins = [
|
||||||
new ExtractTextPlugin('bundle.css', { allChunks: true }),
|
new MiniCssExtractPlugin({
|
||||||
|
// Options similar to the same options in webpackOptions.output
|
||||||
|
// both options are optional
|
||||||
|
filename: 'bundle.css',
|
||||||
|
}),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
|
||||||
@ -16,13 +21,14 @@ const plugins = [
|
|||||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (devMode) {
|
||||||
entry.push('webpack-dev-server/client?http://localhost:3000');
|
entry.push('webpack-dev-server/client?http://localhost:3000');
|
||||||
entry.push('webpack/hot/only-dev-server');
|
entry.push('webpack/hot/only-dev-server');
|
||||||
plugins.push(new webpack.HotModuleReplacementPlugin());
|
plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
mode,
|
||||||
entry,
|
entry,
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
@ -45,9 +51,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /(\.scss)$/,
|
test: /(\.scss)$/,
|
||||||
loader: ExtractTextPlugin.extract({
|
|
||||||
fallback: 'style-loader',
|
|
||||||
use: [
|
use: [
|
||||||
|
{ loader: devMode ? 'style-loader' : MiniCssExtractPlugin.loader },
|
||||||
{
|
{
|
||||||
loader: 'css-loader',
|
loader: 'css-loader',
|
||||||
options: {
|
options: {
|
||||||
@ -65,11 +70,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /(\.css)$/,
|
||||||
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' }),
|
use: [{ loader: devMode ? 'style-loader' : MiniCssExtractPlugin.loader }, { loader: 'css-loader' }],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
1458
frontend/yarn.lock
1458
frontend/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user