fxxk windows

pull/1/head
yutent 2023-02-02 16:39:31 +08:00
parent 4823362b21
commit 20e67d2d4a
2 changed files with 8 additions and 5 deletions

View File

@ -142,7 +142,10 @@ export function parseJs(
let tmp = `style${Date.now()}`
fixedStyle += `document.adoptedStyleSheets.push(${tmp})\n`
return `import ${tmp} from '${name}' assert { type: 'css' }\n${tmp}.path = '${name}'`
return `import ${tmp} from '${name}' assert { type: 'css' }\n${tmp}.path = '${name.replace(
/\\/g,
'\\\\'
)}'`
} else {
if (name.startsWith('@/')) {
name = name.replace('@/', '/assets/js/')
@ -213,9 +216,9 @@ export function compileVue(file, imports, options = {}, isBuild) {
js += `
let stylesheet = new CSSStyleSheet()
stylesheet.path = '${file.slice(
options.IS_MPA ? options.pagesDir.length : options.root.length
)}'
stylesheet.path = '${file
.slice(options.IS_MPA ? options.pagesDir.length : options.root.length)
.replace(/\\/g, '\\\\')}'
stylesheet.replaceSync(\`${CACHE[file].css}\`)
document.adoptedStyleSheets.push(stylesheet)
`

View File

@ -1,7 +1,7 @@
{
"name": "@bytedo/vue-live",
"type": "module",
"version": "0.1.1",
"version": "0.1.2",
"bin": {
"vue-live": "index.js"
},