Skip to content

Commit 2ef0f18

Browse files
committed
actually use the vite base url when available
1 parent c4877b6 commit 2ef0f18

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@idrinth-api-bench/rollup-plugin-react-modular-css",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "Provides a plugin to split css files out separately.",
55
"main": "src/index.js",
66
"repository": {

src/load.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export default (hash: string, name: string) => {
22
const global = window || this || {};
33
const header = global.document.getElementsByTagName('head')[0];
4-
const path = `/assets/${name}-${hash}.min.css`;
4+
// @ts-ignore
5+
const prefix= import.meta.env.BASE_URL ?? '';
6+
const path = `${prefix}/assets/${name}-${hash}.min.css`;
57
if (global.document.querySelector(`link[href='${ path }']`)) {
68
return;
79
}

0 commit comments

Comments
 (0)