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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v7
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
name: build
node-version: 20
- run: npm ci
- run: npm run build:ghpages
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"scripts": {
"clean": "rm -rf dist ./src/versionInfo.ts",
"build": "npm run clean && npm run build-version && npm run typecheck && npm run build-dist && npm run postbuild-js",
"build:ghpages": "npm run clean && npm run build-version && npm run typecheck && PUBLIC_PATH=/mashlib/dist/ npm run build-dist && npm run postbuild-js",
"build-version": "./timestamp.sh > src/versionInfo.ts && eslint 'src/versionInfo.ts' --fix",
"build-dist": "webpack --progress --mode=production",
"postbuild-js": "rm -f dist/versionInfo.d.ts dist/versionInfo.d.ts.map",
Expand Down
4 changes: 2 additions & 2 deletions static/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
}, true);
</script>
<link type="text/css" rel="stylesheet" href="mash.css" />
<script type="text/javascript" src="mashlib.js"></script>
<link type="text/css" rel="stylesheet" href="/mash.css" />
<script type="text/javascript" src="/mashlib.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const authn = SolidLogic.authn
Expand Down
5 changes: 2 additions & 3 deletions webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ const common = {
target: 'web',
output: {
path: path.resolve(process.cwd(), 'dist'),
// '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',
// Use /mashlib/dist/ for GitHub Pages, / for localhost
publicPath: process.env.PUBLIC_PATH || '/',
library: {
name: 'Mashlib',
type: 'umd'
Expand Down