11const path = require ( 'path' ) ;
22const PrerenderSPAPlugin = require ( 'prerender-spa-plugin' ) ;
33
4- // const zopfli = require('@gfx/zopfli');
5-
64// const fs = require('fs');
75// const StatsPlugin = require('stats-webpack-plugin');
86
@@ -19,31 +17,8 @@ module.exports = {
1917 } ,
2018 } ,
2119 sourceMap : false ,
22- // extract: {
23- // filename: 'css/[name].css',
24- // chunkFilename: 'css/[name].css',
25- // },
26- } ,
27- pluginOptions : {
28- // compression: {
29- // zopfli: {
30- // filename: '[path]',
31- // include: /\.js$|\.css$/,
32- // exclude: /cm\/|code\//,
33- // compressionOptions: {
34- // numiterations: 15,
35- // },
36- // algorithm(input, compressionOptions, callback) {
37- // return zopfli.gzip(input, compressionOptions, callback);
38- // },
39- // },
40- // },
4120 } ,
4221 configureWebpack : {
43- // output: {
44- // filename: 'js/[name].js',
45- // chunkFilename: 'js/[name].js',
46- // },
4722 resolve : {
4823 alias : {
4924 // bundle size optimatization
@@ -54,9 +29,7 @@ module.exports = {
5429 plugins : [
5530 // new StatsPlugin('stats.json'),
5631 process . env . NODE_ENV ? new PrerenderSPAPlugin ( {
57- // Required - The path to the webpack-outputted app to prerender.
5832 staticDir : path . join ( __dirname , 'dist' ) ,
59- // Required - Routes to render.
6033 routes : [ '/' , '/about' , '/contribute' ] ,
6134 } ) : null ,
6235 ] ,
@@ -82,16 +55,6 @@ module.exports = {
8255 headers : {
8356 'Access-Control-Allow-Origin' : '*' ,
8457 } ,
85- // before(app) {
86- // app.use((req, res, next) => {
87- // if (req.path.slice(0, 4) === '/cm/') {
88- // res.header('content-encoding', 'gzip');
89- // }
90- // next();
91- // });
92- // },
93-
94- // compress: false,
9558 // https: {
9659 // key: fs.readFileSync(`${process.env.HOME}/localhost.key`),
9760 // cert: fs.readFileSync(`${process.env.HOME}/localhost.crt`),
0 commit comments