File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/compiler-sfc/src/style Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { warn } from '../warn'
1010
1111const animationNameRE = / ^ ( - \w + - ) ? a n i m a t i o n - n a m e $ /
1212const animationRE = / ^ ( - \w + - ) ? a n i m a t i o n $ /
13+ const keyframesRE = / ^ (?: - \w + - ) ? k e y f r a m e s $ /
1314
1415const scopedPlugin : PluginCreator < string > = ( id = '' ) => {
1516 const keyframes = Object . create ( null )
@@ -21,10 +22,7 @@ const scopedPlugin: PluginCreator<string> = (id = '') => {
2122 processRule ( id , rule )
2223 } ,
2324 AtRule ( node ) {
24- if (
25- / - ? k e y f r a m e s $ / . test ( node . name ) &&
26- ! node . params . endsWith ( `-${ shortId } ` )
27- ) {
25+ if ( keyframesRE . test ( node . name ) && ! node . params . endsWith ( `-${ shortId } ` ) ) {
2826 // register keyframes
2927 keyframes [ node . params ] = node . params = node . params + '-' + shortId
3028 }
@@ -72,7 +70,7 @@ function processRule(id: string, rule: Rule) {
7270 processedRules . has ( rule ) ||
7371 ( rule . parent &&
7472 rule . parent . type === 'atrule' &&
75- / - ? k e y f r a m e s $ / . test ( ( rule . parent as AtRule ) . name ) )
73+ keyframesRE . test ( ( rule . parent as AtRule ) . name ) )
7674 ) {
7775 return
7876 }
You can’t perform that action at this time.
0 commit comments