Skip to content

Commit bff0508

Browse files
authored
Merge pull request #294 from SolidOS/287publicPath
a different approach to publicPath
2 parents 3e859f5 + 5ab2825 commit bff0508

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ jobs:
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
- run: npm ci
25-
- name: Build with GitHub Pages publicPath
26-
run: npm run build
27-
env:
28-
PUBLIC_PATH: /mashlib/dist/
25+
- run: npm run build
2926
- run: npm run bundlesize
3027
- name: Save build
3128
if: matrix.node-version == 20

webpack.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const common = {
2323
target: 'web',
2424
output: {
2525
path: path.resolve(process.cwd(), 'dist'),
26-
// Use PUBLIC_PATH env var for deployment (e.g., '/mashlib/dist/' for GitHub Pages)
27-
// Defaults to '/' for local development and production
28-
publicPath: process.env.PUBLIC_PATH || '/',
26+
// 'auto' determines the public path at runtime based on the script's location
27+
// This works for both the HTML file and dynamically loaded chunks
28+
publicPath: 'auto',
2929
library: {
3030
name: 'Mashlib',
3131
type: 'umd'

0 commit comments

Comments
 (0)