Skip to content

Commit

Permalink
build: reintroduce npm package build
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed May 16, 2024
1 parent e2c4361 commit af3be35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/npm-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ jobs:
run: npm ci

- name: Build
run: npm run build
run: npm run build -- --config vite-publish.config.js

- name: Copy index.js
run: npx ncp dist/dist/elements/out/index.mjs dist/dist/elements/index.js

- name: Delete irrelevant files
run: npx rimraf dist/assets dist/*.* dist/dist/index.js
run: npx rimraf dist/dist/elements/out

- name: Copy custom-elements.json
run: npx ncp custom-elements.json dist/custom-elements.json
Expand Down
10 changes: 10 additions & 0 deletions vite-publish.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
build: {
lib: {
entry: 'src/elements/index.ts',
fileName: 'index',
formats: ['es'],
},
outDir: 'dist/dist/elements/out',
},
};

0 comments on commit af3be35

Please sign in to comment.