Skip to content

Instantly share code, notes, and snippets.

@Weiyuan-Lane
Last active August 11, 2019 10:14
Show Gist options
  • Save Weiyuan-Lane/d4aba202f7cb7da87fa2842d05ccf5e2 to your computer and use it in GitHub Desktop.
Save Weiyuan-Lane/d4aba202f7cb7da87fa2842d05ccf5e2 to your computer and use it in GitHub Desktop.
Next.js config for build process with base path as asset prefix
const basePath = '/spa-github-page-template'; // or '' if basePath needs to be left unchanged
const webpackBasePath = process.env.SPA_EXP_BUILD === 'true' ? basePath : '';
module.exports = {
assetPrefix: webpackBasePath,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment