wulkanowy.github.io/vue.config.js

49 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2020-04-18 18:21:09 +02:00
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
2020-02-02 13:07:41 +01:00
const routes = require('./src/routes');
2020-04-18 18:21:09 +02:00
const faqMap = require('./src/assets/faq-map.json');
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer;
2020-02-02 13:07:41 +01:00
2019-02-24 18:22:51 +01:00
module.exports = {
2019-12-07 14:18:08 +01:00
publicPath: '/',
2020-02-02 13:07:41 +01:00
pluginOptions: {
sitemap: {
baseURL: 'https://wulkanowy.github.io',
outputDir: 'dist/',
pretty: true,
routes,
},
},
2020-04-18 18:21:09 +02:00
configureWebpack: {
plugins: [
new HtmlWebpackPlugin({
template: 'public/index.html',
filename: path.resolve(__dirname, 'dist/index.html'),
favicon: 'public/favicon.ico',
}),
new PrerenderSPAPlugin({
staticDir: path.join(__dirname, 'dist'),
routes: [
'/polityka-prywatnosci',
'/czesto-zadawane-pytania',
...faqMap.map((item) => `/czesto-zadawane-pytania/${item.id}`),
],
renderer: new Renderer({
headless: true,
renderAfterDocumentEvent: 'x-app-rendered',
}),
}),
],
},
2019-12-07 14:18:08 +01:00
chainWebpack: (config) => {
config.module
.rule('md')
.test(/\.md$/)
.use('raw-loader')
.loader('raw-loader')
.end();
},
2019-02-24 18:22:51 +01:00
};