Set a base asset path for gh-pages

This commit is contained in:
jinhojang6 2020-06-12 01:31:29 +09:00
parent 2c4ad94a61
commit d8dd447f61
1 changed files with 5 additions and 1 deletions

View File

@ -7,8 +7,12 @@ const nextRuntimeDotenv = require("next-runtime-dotenv");
const withConfig = nextRuntimeDotenv({ public: ["API_URL", "API_KEY"] });
const nextConfig = {
// or '' if basePath needs to be left unchanged
const basePath = '.';
const webpackBasePath = process.env.NODE_ENV = 'production' ? basePath : '';
const nextConfig = {
assetPrefix: webpackBasePath,
analyzeServer: ["server", "both"].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ["browser", "both"].includes(process.env.BUNDLE_ANALYZE),
bundleAnalyzerConfig: {