vite-plugin-import-package-style
v1.0.4
Published
Vite plugin to automatically import styles from packages
Downloads
3
Maintainers
Readme
vite-plugin-import-package-style
Vite plugin to automatically import styles from packages
Install
npm i -D vite-plugin-import-package-style
Usage
// vite.config.ts
import { defineConfig } from 'vite';
import { importPackageStyle } from 'vite-plugin-import-package-style';
export default defineConfig({
plugins: [
importPackageStyle({
rules: [
{
include: ['foobar', '@foo/*'],
exclude: ['@foo/bar-*'],
resolveStyle: (pkg) => {
return `${pkg}/dist/index.css`;
},
},
],
}),
],
});