Skip to content

Commit

Permalink
🚀 include components bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed May 14, 2024
1 parent 3bd2095 commit 58d519a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
],
"scripts": {
"build": "vite build",
"postbuild": "cp ./sample.resume.json ./dist",
"postbuild": "npm run components",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token=chpt_0f59236527eec54",
"components": "vite build -c vite.components.config.js --emptyOutDir false",
"dev": "vite",
"format": "prettier .",
"lint": "eslint --ignore-pattern .gitignore ./components",
Expand Down
20 changes: 20 additions & 0 deletions vite.components.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'vite'
import pkg from './package.json'

export default defineConfig(({ mode }) => {
return {
build: {
copyPublicDir: false,
lib: {
entry: './components/index.js',
fileName: 'components',
formats: ['es'],
name: 'jsonresumeMicrodataComponents',
},
rollupOptions: {
external: [...Object.keys(pkg.dependencies), /^node:.*/],
},
target: 'esnext',
},
}
})
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default defineConfig(({ mode }) => {
{ src: './README.md', dest: '.' },
{ src: './schema.json', dest: '.' },
{ src: './style.css', dest: '.' },
{ src: './sample.resume.json', dest: '.' },
],
}),
],
Expand Down

0 comments on commit 58d519a

Please sign in to comment.