Skip to content

Commit f04e2d7

Browse files
inject css so it’s loaded as an external dependency
1 parent 945f008 commit f04e2d7

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bufferhead/nightowl",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"type": "module",
55
"scripts": {
66
"dev": "vite",
@@ -12,6 +12,11 @@
1212
"postcss": "^8.4.31",
1313
"postcss-nesting": "^12.0.1",
1414
"typescript": "^5.2.2",
15-
"vite": "^5.0.0"
16-
}
15+
"vite": "^5.0.0",
16+
"vite-plugin-lib-inject-css": "^1.3.0"
17+
},
18+
"sideEffects": [
19+
"**/*.css"
20+
]
21+
1722
}

vite.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// vite.config.js
22
import { resolve } from 'path'
33
import { defineConfig } from 'vite'
4+
import { libInjectCss } from 'vite-plugin-lib-inject-css';
45

56
export default defineConfig({
7+
plugins: [
8+
libInjectCss(), // For a simple usage
9+
],
610
build: {
711
lib: {
812
// Could also be a dictionary or array of multiple entry points
@@ -11,8 +15,10 @@ export default defineConfig({
1115
// the proper extensions will be added
1216
fileName: 'nightowl',
1317
},
14-
rollupOptions: {
15-
16-
},
17-
},
18+
rollupOption: {
19+
output: {
20+
intro: 'import "./style.css";',
21+
}
22+
}
23+
}
1824
})

0 commit comments

Comments
 (0)