Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Build with GitHub Pages publicPath
run: npm run build
env:
PUBLIC_PATH: /mashlib/dist/
- run: npm run build
- run: npm run bundlesize
- name: Save build
if: matrix.node-version == 20
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const common = {
target: 'web',
output: {
path: path.resolve(process.cwd(), 'dist'),
// Use PUBLIC_PATH env var for deployment (e.g., '/mashlib/dist/' for GitHub Pages)
// Defaults to '/' for local development and production
publicPath: process.env.PUBLIC_PATH || '/',
// 'auto' determines the public path at runtime based on the script's location
// This works for both the HTML file and dynamically loaded chunks
publicPath: 'auto',
library: {
name: 'Mashlib',
type: 'umd'
Expand Down