-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
41 lines (39 loc) · 1.01 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// const withPWA = require("next-pwa");
const EXPORT_TO_GH_PAGES = false;
const GH_PAGES_REPO_NAME = "polyrhythm3";
const basePath =
process.env.NODE_ENV === "production" && EXPORT_TO_GH_PAGES
? `/${GH_PAGES_REPO_NAME}`
: "";
module.exports = {
output: 'export',
basePath,
assetPrefix: `${basePath}/`,
webpack: (cfg) => {
const originalEntry = cfg.entry;
cfg.entry = async () => {
const entries = await originalEntry();
if (entries["main.js"])
entries["main.js"].unshift("./client/polyfills.js");
return entries;
};
return cfg;
},
};
// module.exports = withPWA({
// pwa: {
// dest: "public",
// },
// basePath,
// assetPrefix: `${basePath}/`,
// webpack: (cfg) => {
// const originalEntry = cfg.entry;
// cfg.entry = async () => {
// const entries = await originalEntry();
// if (entries["main.js"])
// entries["main.js"].unshift("./client/polyfills.js");
// return entries;
// };
// return cfg;
// },
// });