From 4ebe2c6c7c19e24d4d82f71f57f6c1db54bc7a4a Mon Sep 17 00:00:00 2001 From: Mael Date: Thu, 1 Mar 2018 20:30:57 +0100 Subject: [PATCH] :arrow_up: Migration vers webpack 4 --- package.json | 123 ++++++++++++++++++++------------------- source/.babelrc | 2 +- source/webpack.common.js | 2 +- source/webpack.dev.js | 1 + 4 files changed, 66 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index ed223b7f3..6b6cf2c39 100644 --- a/package.json +++ b/package.json @@ -10,99 +10,102 @@ "engines": { "node": ">=6.2.0 <10.0.0" }, - "browserslist": ["> 1% in FR", "not ie < 11"], + "browserslist": [ + "> 1% in FR", + "not ie < 11" + ], "dependencies": { - "@babel/polyfill": "^7.0.0-beta.34", + "live-server": "^1.2.0", + "@babel/core": "^7.0.0-beta.40", + "@babel/plugin-proposal-decorators": "=7.0.0-beta.40", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.40", + "@babel/plugin-syntax-decorators": "^7.0.0-beta.40", + "@babel/polyfill": "^7.0.0-beta.40", + "@babel/preset-env": "^7.0.0-beta.40", + "@babel/preset-react": "^7.0.0-beta.40", + "akh": "^3.1.2", + "autoprefixer": "^8.0.0", + "babel-eslint": "^8.2.2", + "babel-loader": "8.0.0-beta.2", + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-plugin-transform-do-expressions": "^6.22.0", + "babel-plugin-webpack-alias": "^2.1.2", + "chai": "^4.1.2", "classnames": "^2.2.5", + "core-js": "^2.5.3", + "css-loader": "^0.28.10", + "csv-loader": "^2.1.1", + "daggy": "^1.2.0", "dedent-js": "^1.0.1", "deep-assign": "^2.0.0", + "eslint": "^4.18.1", + "eslint-plugin-react": "^7.7.0", + "express": "^4.16.2", + "fantasy-combinators": "0.0.1", + "fantasy-land": "^3.5.0", + "fantasy-tuples": "^1.0.0", + "file-loader": "^1.1.10", "flow": "^0.2.3", "fuse.js": "^3.2.0", "global": "^4.3.2", "google-translate-api": "^2.3.0", "i18next": "^10.0.7", "ignore-loader": "^0.1.2", - "js-yaml": "^3.9.1", - "live-server": "^1.2.0", - "marked": "^0.3.9", - "mocha": "^5.0.0", + "hard-source-webpack-plugin": "^0.6.0", + "html-loader": "^0.5.5", + "ignore-loader": "^0.1.2", + "js-yaml": "^3.10.0", + "jsdom": "^11.6.2", + "json-loader": "^0.5.7", + "marked": "^0.3.17", + "mocha": "^5.0.1", "mocha-webpack": "^1.0.1", - "nearley": "^2.9.2", + "nearley": "^2.11.1", + "nearley-loader": "^0.0.3", + "npm": "^5.6.0", + "postcss-loader": "^2.1.1", "ramda": "^0.25.0", + "ramda-fantasy": "^0.8.0", "rc-progress": "^2.2.5", "react": "^16.2.0", "react-addons-css-transition-group": "^15.6.2", - "react-color": "^2.13.8", + "react-color": "^2.14.0", "react-dom": "^16.2.0", "react-helmet": "^5.2.0", - "react-highlight-words": "^0.10.0", "react-i18next": "^7.5.0", - "react-redux": "^5.0.6", + "react-highlight-words": "^0.11.0", + "react-hot-loader": "^4.0.0", + "react-redux": "^5.0.7", "react-router": "^4.2.0", "react-router-dom": "^4.2.2", - "react-scroll": "^1.7.6", - "react-select": "^1.2.0", + "react-scroll": "^1.7.7", + "react-select": "^1.2.1", "react-select-fast-filter-options": "^0.2.3", "react-transition-group": "^2.2.1", - "react-virtualized": "^9.10.1", - "react-virtualized-select": "^3.1.0", + "react-virtualized": "^9.18.5", + "react-virtualized-select": "^3.1.3", "reduce-reducers": "^0.1.2", "redux": "^3.7.2", + "redux-devtools": "^3.4.1", + "redux-devtools-dock-monitor": "^1.1.3", + "redux-devtools-log-monitor": "^1.4.0", "redux-form": "^7.2.3", "reselect": "^3.0.1", "screenfull": "^3.3.2", + "source-map-support": "^0.5.3", + "style-loader": "^0.20.2", + "url-loader": "^0.6.2", + "webpack": "^4.0.1", + "webpack-dev-server": "^3.1.0", "whatwg-fetch": "^2.0.3", "yaml-loader": "^0.5.0" }, - "devDependencies": { - "@babel/core": "^7.0.0-beta.34", - "@babel/plugin-proposal-decorators": "=7.0.0-beta.34", - "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.34", - "@babel/plugin-syntax-decorators": "^7.0.0-beta.34", - "@babel/preset-env": "^7.0.0-beta.34", - "@babel/preset-react": "^7.0.0-beta.34", - "akh": "^3.1.2", - "autoprefixer": "^7.2.4", - "babel-eslint": "^8.2.1", - "babel-loader": "8.0.0-beta.0", - "babel-plugin-syntax-dynamic-import": "^6.18.0", - "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-decorators": "^6.24.1", - "babel-plugin-transform-do-expressions": "^6.22.0", - "babel-plugin-webpack-alias": "^2.1.2", - "chai": "^4.0.2", - "core-js": "^2.4.1", - "css-loader": "^0.28.1", - "csv-loader": "^2.1.1", - "daggy": "^1.1.0", - "eslint": "^4.17.0", - "eslint-plugin-react": "^7.6.1", - "express": "^4.15.3", - "fantasy-combinators": "0.0.1", - "fantasy-land": "^3.3.0", - "fantasy-tuples": "^1.0.0", - "file-loader": "^1.1.6", - "hard-source-webpack-plugin": "^0.5.18", - "html-loader": "^0.5.1", - "jsdom": "^11.0.0", - "json-loader": "^0.5.4", - "nearley-loader": "0.0.2", - "postcss-loader": "^2.0.5", - "ramda-fantasy": "^0.8.0", - "react-hot-loader": "^3.1.3", - "redux-devtools": "^3.4.1", - "redux-devtools-dock-monitor": "^1.1.2", - "redux-devtools-log-monitor": "^1.4.0", - "source-map-support": "^0.5.0", - "style-loader": "^0.19.0", - "url-loader": "^0.6.2", - "webpack": "^3.10.0", - "webpack-dev-server": "^2.9.5" - }, "scripts": { "start": "node source/server.js", "externalize": "node source/externalize.js", - "compile": "NODE_ENV='production' webpack --config source/webpack.prod.js", + "compile": "webpack --config source/webpack.prod.js", "test": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\"", "test-watch": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch", "test-meca": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch", diff --git a/source/.babelrc b/source/.babelrc index 51ceef661..ad8f0e155 100644 --- a/source/.babelrc +++ b/source/.babelrc @@ -15,6 +15,6 @@ "transform-class-properties", "syntax-dynamic-import", "react-hot-loader/babel", - ["webpack-alias", { "config": "./source/webpack.config.js" }] + ["webpack-alias", { "config": "./source/webpack.dev.js" }] ] } diff --git a/source/webpack.common.js b/source/webpack.common.js index 43292dcaa..168b3e5c3 100644 --- a/source/webpack.common.js +++ b/source/webpack.common.js @@ -14,7 +14,7 @@ module.exports = { publicPath: '/dist/' }, module: { - loaders: [ + rules: [ { test: /\.css$/, use: [ diff --git a/source/webpack.dev.js b/source/webpack.dev.js index 0e6f24ecf..51ec554e1 100644 --- a/source/webpack.dev.js +++ b/source/webpack.dev.js @@ -5,6 +5,7 @@ var webpack = require('webpack'), module.exports = { ...common, + mode: 'development', entry: { bundle: [ 'webpack-dev-server/client?http://0.0.0.0:3000/',