File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
src/sandbox/eval/transpilers Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 11// @flow
2- import Core from 'css-modules-loader-core' ;
32import { type LoaderContext } from '../../transpiled-module' ;
43
5- const core = new Core ( ) ;
4+ let core = null ;
65
7- export default ( code : string , loaderContext : LoaderContext ) =>
8- core
6+ export default async ( code : string , loaderContext : LoaderContext ) => {
7+ if ( ! core ) {
8+ const Core = await import ( 'css-modules-loader-core' ) ;
9+
10+ core = new Core ( ) ;
11+ }
12+
13+ return core
914 . load ( code , loaderContext . path , ( dependencyPath : string ) => {
1015 const tModule = loaderContext . addDependency ( dependencyPath ) ;
1116
@@ -15,3 +20,4 @@ export default (code: string, loaderContext: LoaderContext) =>
1520 css : injectableSource ,
1621 exportTokens,
1722 } ) ) ;
23+ } ;
Original file line number Diff line number Diff line change @@ -21,15 +21,17 @@ const getStyleFileName = attrs => {
2121} ;
2222
2323const getStyleLoaders = ( attrs , id , scoped ) => {
24- let loader = `!style-loader!vue-style-compiler?${ JSON . stringify ( {
25- id,
26- scoped : ! ! scoped ,
27- } ) } `;
24+ let loader = `!style-loader` ;
2825
2926 if ( attrs . module ) {
3027 loader += `?${ JSON . stringify ( { module : true } ) } ` ;
3128 }
3229
30+ loader += `!vue-style-compiler?${ JSON . stringify ( {
31+ id,
32+ scoped : ! ! scoped ,
33+ } ) } `;
34+
3335 if ( attrs . lang === 'scss' ) loader += '!sass-loader' ;
3436 if ( attrs . lang === 'sass' ) loader += '!sass-loader' ;
3537 if ( attrs . lang === 'styl' || attrs . lang === 'stylus' )
You can’t perform that action at this time.
0 commit comments