This commit is contained in:
ritz078 committed 2018-04-26 18:21:02 +05:30
1 parent eaad5a1c91
commit 84c2b00a16
4 files changed
+40 -55

No files matched your search

+9 -6
View File
@@ -2,7 +2,6 @@ const webpack = require("webpack");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { ANALYZE } = process.env;
const glob = require("glob");
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin");
const LodashModuleReplacementPlugin = require("lodash-webpack-plugin");
module.exports = {
@@ -61,11 +60,15 @@ module.exports = {
exportPathMap() {
const pathMap = {};
glob.sync("pages/**/*.js", { ignore: "pages/_document.js" }).forEach(s => {
const path = s.split(/(pages|\.)/)[2].replace(/^\/index$/, "/");
console.log(path);
pathMap[path] = { page: path };
});
glob
.sync("pages/**/*.js", {
ignore: ["pages/_document.js", "pages/_app.js"]
})
.forEach(s => {
const path = s.split(/(pages|\.)/)[2].replace(/^\/index$/, "/");
console.log(path);
pathMap[path] = { page: path };
});
return pathMap;
}
};