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

View File

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