Skip to content

Commit

Permalink
chore(kv-components): define peer and bundle dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
emuvente committed Jan 17, 2025
1 parent c084ad8 commit 1d26d7a
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 47 deletions.
47 changes: 30 additions & 17 deletions @kiva/kv-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@kiva/kv-tokens": "^2.16.1",
"@laynezh/vite-plugin-lib-assets": "^0.6.1",
"@mdi/js": "^7.4.47",
"@storybook/addon-a11y": "^8.4.7",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
Expand All @@ -37,21 +39,32 @@
"@vitejs/plugin-vue": "^5.2.1",
"@vue/reactivity": "3.2.37",
"@vue/vue3-jest": "^27.0.0-alpha.4",
"@vueuse/integrations": "^9.13.0",
"aria-hidden": "^1.2.4",
"autoprefixer": "^10.4.2",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^27.0.6",
"babel-loader": "^8.2.2",
"change-case": "^4.1.2",
"chromatic": "^5.9.2",
"css-loader": "^6.0.0",
"date-fns": "^2.30.0",
"embla-carousel": "^8.5.2",
"embla-carousel-autoplay": "^8.5.2",
"embla-carousel-fade": "^8.5.2",
"eslint": "^7.26.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-storybook": "^0.5.6",
"eslint-plugin-vue": "^7.9.0",
"flag-icons": "^7.3.0",
"focus-trap": "^6.9.4",
"import-meta-loader": "^1.1.0",
"jest": "^27.4.3",
"jest-axe": "^5.0.1",
"nanoid": "^3.3.8",
"numeral": "^2.0.6",
"popper.js": "^1.16.1",
"postcss": "^8.4.5",
"postcss-loader": "^7.0.0",
"react": "^16.8.0",
Expand All @@ -75,22 +88,22 @@
"build": "vite build",
"postbuild": "mkdir -p ../../dist/kvui && mv -v dist/kvui/* ../../dist/kvui/"
},
"dependencies": {
"@kiva/kv-tokens": "^2.16.1",
"@mdi/js": "^7.4.47",
"@vueuse/integrations": "^9.13.0",
"aria-hidden": "^1.1.3",
"change-case": "^4.1.2",
"date-fns": "^2.30.0",
"embla-carousel": "^8.5.1",
"embla-carousel-autoplay": "^8.5.1",
"embla-carousel-fade": "^8.5.1",
"focus-trap": "^6.7.2",
"nanoid": "^3.1.23",
"numeral": "^2.0.6",
"popper.js": "^1.16.1"
},
"peerDependencies": {
"vue": ">=3.0.0"
}
"@kiva/kv-tokens": "2.x",
"@mdi/js": "7.x",
"@vueuse/integrations": "9.x",
"change-case": "4.x",
"date-fns": "2.x",
"focus-trap": "6.x",
"nanoid": "3.x",
"numeral": "2.x",
"vue": "3.x"
},
"bundledDependencies": [
"aria-hidden",
"embla-carousel",
"embla-carousel-autoplay",
"embla-carousel-fade",
"popper.js"
]
}
10 changes: 10 additions & 0 deletions @kiva/kv-components/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,39 @@ export default defineConfig({
},
build: {
outDir: 'dist',
// Ensure that separate css files are created for each component with styles
cssCodeSplit: true,
// Enable Vite library mode
lib: {
entry: 'src/index.js',
formats: ['es'],
fileName: (format, entryName) => {
// Add .js or .cjs suffix to entryName based on format
const suffix = format === 'es' ? '.js' : '.cjs';
// Remove .vue extension from entryName for SFCs
if (entryName.slice(-4) === '.vue') {
return `${entryName.slice(0, -4)}${suffix}`;
}
// Return default entryName
return `${entryName}${suffix}`;
},
},
},
plugins: [
// Support Vue 3 single-file components
vue(),
// Make the output match the src file structure instead of bundling into one large file
noBundlePlugin({
// Dependencies that should be included in the final build. Update package.json bundledDependencies when changing this list.
internal: [
'aria-hidden',
'embla-carousel',
'embla-carousel-autoplay',
'embla-carousel-fade',
'popper.js',
],
}),
// Ensure assets are created in the dist folder when using Vite library mode
libAssetsPlugin({
name: '[name].[contenthash:8].[ext]',
outputPath: 'kvui',
Expand Down
Loading

0 comments on commit 1d26d7a

Please sign in to comment.