Add SPA prerendering plugin for SEO

This commit is contained in:
Jan Tuomi
2018-06-20 16:04:12 +03:00
parent 5a89162e46
commit 7502eb5eef
3 changed files with 2338 additions and 5269 deletions
+11 -2
View File
@@ -1,6 +1,8 @@
// production config
const merge = require('webpack-merge');
const {resolve} = require('path');
const path = require('path')
const resolve = path.resolve;
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const commonConfig = require('./common');
@@ -13,5 +15,12 @@ module.exports = merge(commonConfig, {
publicPath: '/',
},
devtool: 'source-map',
plugins: [],
plugins: [
new PrerenderSPAPlugin({
// Required - The path to the webpack-outputted app to prerender.
staticDir: resolve(__dirname, '../../dist'),
// Required - Routes to render.
routes: ['/'],
})
],
});
+2322 -5264
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -49,6 +49,7 @@
"css-loader": "^0.28.11",
"express": "^4.16.3",
"file-loader": "^1.1.11",
"fs-extra": "^6.0.1",
"html-webpack-plugin": "^3.2.0",
"husky": "^1.0.0-rc.9",
"image-webpack-loader": "^4.3.0",
@@ -57,6 +58,7 @@
"npm-run-all": "^4.1.3",
"plop": "^2.0.0",
"postcss-loader": "^2.1.5",
"puppeteer": "^1.5.0",
"react": "^16.4.0",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.4.0",
@@ -69,17 +71,17 @@
"stylelint-webpack-plugin": "^0.10.5",
"testcafe": "^0.20.3",
"tslint": "^5.10.0",
"typescript": "^2.9.1",
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "^4.11.1",
"webpack-cli": "^3.0.3",
"webpack-dev-middleware": "^3.1.3",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.2"
"webpack-merge": "^4.1.2",
"dotenv-webpack": "^1.5.7",
"prerender-spa-plugin": "^3.2.1"
},
"dependencies": {
"axios": "^0.18.0",
"dotenv-webpack": "^1.5.7",
"mobx": "^5.0.3",
"mobx-react": "^5.2.3",
"normalize.css": "^8.0.0"