diff --git a/package.json b/package.json index 8e58e84cf..2fe70fb95 100644 --- a/package.json +++ b/package.json @@ -158,6 +158,7 @@ "source-map-support": "^0.5.4", "style-loader": "^0.23.1", "styled-components": "^4.2.0", + "toml-loader": "^1.0.0", "url-loader": "^1.0.1", "webpack": "^4.39.3", "webpack-cli": "^3.1.2", diff --git a/source/sites/mon-entreprise.fr/App.js b/source/sites/mon-entreprise.fr/App.js index 9404f2c41..8206b63a5 100644 --- a/source/sites/mon-entreprise.fr/App.js +++ b/source/sites/mon-entreprise.fr/App.js @@ -8,7 +8,7 @@ import Raven from 'raven-js' import React, { useEffect } from 'react' import { Helmet } from 'react-helmet' import { useTranslation } from 'react-i18next' -import { Route, Switch } from 'react-router-dom' +import { Redirect, Route, Switch } from 'react-router-dom' import 'Ui/index.css' import Provider from '../../Provider' import { persistEverything, retrievePersistedState } from '../../storage/persistEverything' @@ -31,6 +31,7 @@ import Integration from './pages/integration/index' import Landing from './pages/Landing/Landing.js' import Simulateurs from './pages/Simulateurs' import ÉconomieCollaborative from './pages/ÉconomieCollaborative' +import redirects from './redirects' import { constructLocalizedSitePath } from './sitePaths' @@ -101,6 +102,8 @@ const App = compose(withSitePaths)(({ sitePaths }) => {
+ {redirects} + status === 301 && !from.startsWith('https')) + .map(x => console.log(x) || x) + .map(({ from, to }) => + + ) \ No newline at end of file diff --git a/source/webpack.common.js b/source/webpack.common.js index edd74dbc9..e2f9caa14 100644 --- a/source/webpack.common.js +++ b/source/webpack.common.js @@ -117,7 +117,10 @@ module.exports.commonLoaders = ({ legacy = false } = {}) => { test: /\.yaml$/, use: ['json-loader', 'yaml-loader'] }, - + { + test: /\.toml$/, + use: ['toml-loader'] + }, { test: /\.ne$/, use: [babelLoader, 'nearley-loader'] diff --git a/yarn.lock b/yarn.lock index 8e6857895..c6e797a10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10803,6 +10803,18 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toml-loader@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toml-loader/-/toml-loader-1.0.0.tgz#05249b9294b623601148260caa480b22a653a19a" + integrity sha1-BSSbkpS2I2ARSCYMqkgLIqZToZo= + dependencies: + toml "^2.2.2" + +toml@^2.2.2: + version "2.3.6" + resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.6.tgz#25b0866483a9722474895559088b436fd11f861b" + integrity sha512-gVweAectJU3ebq//Ferr2JUY4WKSDe5N+z0FvjDncLGyHmIDoxgY/2Ie4qfEIDm4IS7OA6Rmdm7pdEEdMcV/xQ== + topo@2.x.x: version "2.0.2" resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182"