diff --git a/.prettierignore b/.prettierignore index caaaea425a..011b79aa1a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,3 +5,4 @@ public/ src/components/index.js src/containers/index.js src/forms/index.js +src/routeConfiguration.js diff --git a/CHANGELOG.md b/CHANGELOG.md index b5f6c60782..a0696cd5ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +- [add] Route-based code splitting. This is done against sharetribe-scripts v5.0.0 using Loadable + components. Read more from the pull request. + [#1411](https://github.com/sharetribe/ftw-daily/pull/1411) + ## [v7.3.0] 2021-01-13 - [fix] Move well-known/\* endpoints related to OIDC proxy setup from `apiRouter` to new diff --git a/package.json b/package.json index 59da6dc232..9e24f00dea 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "dependencies": { "@babel/runtime": "^7.11.2", "@formatjs/intl-relativetimeformat": "^4.2.1", + "@loadable/component": "^5.14.1", + "@loadable/server": "^5.14.2", "@mapbox/polyline": "^1.1.1", "@sentry/browser": "5.20.1", "@sentry/node": "5.20.1", @@ -58,7 +60,7 @@ "redux-thunk": "^2.3.0", "seedrandom": "^3.0.5", "sharetribe-flex-sdk": "1.13.0", - "sharetribe-scripts": "4.0.0", + "sharetribe-scripts": "5.0.0", "smoothscroll-polyfill": "^0.4.0", "source-map-support": "^0.5.9", "url": "^0.11.0" @@ -93,7 +95,9 @@ "dev-frontend": "sharetribe-scripts start", "dev-backend": "nodemon server/apiServer.js", "dev": "yarn run config-check&&export NODE_ENV=development REACT_APP_DEV_API_SERVER_PORT=3500&&concurrently --kill-others \"yarn run dev-frontend\" \"yarn run dev-backend\"", - "build": "sharetribe-scripts build", + "build": "yarn build-web&&yarn build-server", + "build-web": "sharetribe-scripts build", + "build-server": "sharetribe-scripts build-server", "format": "prettier --write '**/*.{js,css}'", "format-ci": "prettier --list-different '**/*.{js,css}'", "format-docs": "prettier --write '**/*.md'", diff --git a/public/index.html b/public/index.html index 434abc51ef..f5769ff87d 100644 --- a/public/index.html +++ b/public/index.html @@ -21,6 +21,8 @@ + +