evanw / evanw/esbuild

Make a separate publicPath for chunks and assets in splitting mode

Open
#3,229 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## Problem
When I build an application to run it on nodejs I get errors when using `publicPath: "/"` because all chunks get the same `publicPath` in `import`. Using `publicPath: "."` will not work, because in this case all assets get this `publicPath` and become inaccessible on pages other than the main page.

## Solution
Separate `publicPath` for chunks and for assets. To maintain backward compatibility, it is possible to make `chunkPublicPath` optional (and use `publicPath` in its absence). What do you think?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how publicPath is applied in splitting mode, especially for imports, chunks, and assets when running on nodejs. Done would mean evaluating the proposed optional chunkPublicPath behavior and its fallback to publicPath while preserving backward compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.