Skip to content

Commit c559345

Browse files
committed
chore: maintain CSS output file name in [email protected]
Without this change, build would fail because the produced stylesheet assumes the `package.json['name']` i.e., `styles/rrweb.css`. To maintain the existing behavior, these changes are required. See https://vite.dev/guide/migration.html#customize-css-output-file-name-in-library-mode
1 parent 548e3f6 commit c559345

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/rrweb/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"default": "./dist/rrweb.cjs"
4646
}
4747
},
48+
"./dist/rrweb.css": "./dist/rrweb.css",
4849
"./dist/style.css": "./dist/style.css"
4950
},
5051
"files": [

vite.config.default.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default function (
115115
build: {
116116
// See https://vitejs.dev/guide/build.html#library-mode
117117
lib: {
118+
cssFileName: 'style',
118119
entry,
119120
name,
120121
fileName,
@@ -133,12 +134,6 @@ export default function (
133134
minify: false,
134135

135136
sourcemap: true,
136-
137-
// rollupOptions: {
138-
// output: {
139-
// manualChunks: {},
140-
// },
141-
// },
142137
},
143138
plugins: [
144139
dts({

0 commit comments

Comments
 (0)