Skip to content

Commit

Permalink
feat: add support for basePath
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Aug 19, 2020
1 parent ef3cf43 commit 96f8b7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = (nextConfig = {}) => {
return Object.assign({}, nextConfig, {
webpack(config, options) {
const { isServer } = options;
nextConfig = Object.assign({ inlineImageLimit: 8192, assetPrefix: "" }, nextConfig);
nextConfig = Object.assign({ inlineImageLimit: 8192, assetPrefix: "", basePath: "" }, nextConfig);

if (!options.defaultLoaders) {
throw new Error(
Expand All @@ -21,7 +21,7 @@ module.exports = (nextConfig = {}) => {
options: {
limit: nextConfig.inlineImageLimit,
fallback: require.resolve("file-loader"),
publicPath: `${nextConfig.assetPrefix}/_next/static/images/`,
publicPath: `${nextConfig.assetPrefix || nextConfig.basePath}/_next/static/images/`,
outputPath: `${isServer ? "../" : ""}static/images/`,
name: "[name]-[hash].[ext]",
esModule: nextConfig.esModule || false
Expand Down

0 comments on commit 96f8b7b

Please sign in to comment.