File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
13+
14+ concurrency :
15+ group : pages
16+ cancel-in-progress : true
17+
18+ jobs :
19+ build :
20+ runs-on : ubuntu-latest
21+
22+ steps :
23+ - name : Check out repository
24+ uses : actions/checkout@v5
25+
26+ - name : Set up pnpm
27+ uses : pnpm/action-setup@v4
28+
29+ - name : Set up Node.js
30+ uses : actions/setup-node@v5
31+ with :
32+ node-version : 22
33+ cache : pnpm
34+
35+ - name : Install dependencies
36+ run : pnpm install --frozen-lockfile
37+
38+ - name : Prepare Pages artifact
39+ run : |
40+ mkdir -p _site
41+ cp index.html _site/index.html
42+ cp -R dist _site/dist
43+
44+ - name : Configure Pages
45+ uses : actions/configure-pages@v5
46+
47+ - name : Upload Pages artifact
48+ uses : actions/upload-pages-artifact@v4
49+ with :
50+ path : _site
51+
52+ deploy :
53+ environment :
54+ name : github-pages
55+ url : ${{ steps.deployment.outputs.page_url }}
56+ runs-on : ubuntu-latest
57+ needs : build
58+
59+ steps :
60+ - name : Deploy to GitHub Pages
61+ id : deployment
62+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -494,13 +494,16 @@ <h2>Toolbar</h2>
494494 </ template >
495495
496496 < script type ="module ">
497- import {
497+ const modulePath = import . meta. env ?. DEV
498+ ? './src/index.ts'
499+ : './dist/index.js' ;
500+ const {
498501 AlertsElement,
499502 MenuElement,
500503 TabsElement,
501504 ToolbarElement,
502505 TooltipElement,
503- } from 'inclusive-elements' ;
506+ } = await import ( modulePath ) ;
504507
505508 customElements . define ( 'ui-menu' , MenuElement ) ;
506509 customElements . define ( 'ui-tooltip' , TooltipElement ) ;
Original file line number Diff line number Diff line change 1- import { resolve } from 'node:path' ;
21import { fileURLToPath } from 'node:url' ;
32import { defineConfig } from 'vite' ;
43
5- const rootDir = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
6-
74export default defineConfig ( {
8- resolve : {
9- alias : {
10- 'inclusive-elements' : resolve ( rootDir , 'src/index.ts' ) ,
11- } ,
12- } ,
135 build : {
146 lib : {
15- entry : resolve ( rootDir , ' src/index.ts') ,
7+ entry : fileURLToPath ( new URL ( './ src/index.ts', import . meta . url ) ) ,
168 formats : [ 'es' ] ,
17- } ,
18- rollupOptions : {
19- output : {
20- entryFileNames : '[name].js' ,
21- chunkFileNames : 'chunks/[name]-[hash].js' ,
22- } ,
9+ fileName : 'index' ,
2310 } ,
2411 } ,
2512} ) ;
You can’t perform that action at this time.
0 commit comments