parent
d80fd97601
commit
a0f06b0171
|
@ -17,7 +17,8 @@ import {
|
|||
HTML_EXP,
|
||||
CSS_SHEET_EXP,
|
||||
HMR_SCRIPT,
|
||||
V_DEEP
|
||||
V_DEEP,
|
||||
PERCENT_EXP
|
||||
} from './constants.js'
|
||||
|
||||
const OPTIONS = {
|
||||
|
@ -43,6 +44,10 @@ function scopeCss(css = '', hash) {
|
|||
|
||||
selector = selector
|
||||
.map(s => {
|
||||
// 针对 @keyframe的处理
|
||||
if (s === 'from' || s === 'to' || PERCENT_EXP.test(s)) {
|
||||
return s
|
||||
}
|
||||
let tmp = s.split(' ')
|
||||
let last = tmp.pop()
|
||||
if (last.includes(':')) {
|
||||
|
|
|
@ -9,7 +9,8 @@ export const STYLE_EXP = /<style([^>]*?)>([\w\W]*?)<\/style>/g
|
|||
export const HTML_EXP = /<template[^>]*?>([\w\W]*?)\n<\/template>/
|
||||
export const V_DEEP = /:deep\(([^)]*?)\)/
|
||||
|
||||
export const CSS_SHEET_EXP = /([@\w\.,#\-:>\+\~\|\(\)\[\]"'\=\s]+)\{/g
|
||||
export const CSS_SHEET_EXP = /([%@\w\.,#\-:>\+\~\|\(\)\[\]"'\=\s]+)\{/g
|
||||
export const PERCENT_EXP = /^\d+%$/
|
||||
|
||||
export const COMMON_HEADERS = {
|
||||
'Cache-Control': 'no-store'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "fite",
|
||||
"type": "module",
|
||||
"version": "0.7.0",
|
||||
"version": "0.7.1",
|
||||
"bin": {
|
||||
"fite": "index.js"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue