File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/ember-auto-import/ts Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ export interface Options {
29
29
alias ?: { [ fromName : string ] : string } ;
30
30
webpack ?: Configuration ;
31
31
publicAssetURL ?: string ;
32
+ styleLoaderOptions ?: Record < string , unknown > ;
33
+ cssLoaderOptions ?: Record < string , unknown > ;
32
34
forbidEval ?: boolean ;
33
35
skipBabel ?: { package : string ; semverRange ?: string } [ ] ;
34
36
watchDependencies ?: ( string | string [ ] ) [ ] ;
@@ -354,6 +356,16 @@ export default class Package {
354
356
return url ;
355
357
}
356
358
359
+ get styleLoaderOptions ( ) : Record < string , unknown > | undefined {
360
+ // only apps (not addons) are allowed to set this
361
+ return this . isAddon ? undefined : this . autoImportOptions ?. styleLoaderOptions ;
362
+ }
363
+
364
+ get cssLoaderOptions ( ) : Record < string , unknown > | undefined {
365
+ // only apps (not addons) are allowed to set this
366
+ return this . isAddon ? undefined : this . autoImportOptions ?. cssLoaderOptions ;
367
+ }
368
+
357
369
get forbidsEval ( ) : boolean {
358
370
// only apps (not addons) are allowed to set this, because it's motivated by
359
371
// the apps own Content Security Policy.
Original file line number Diff line number Diff line change @@ -188,7 +188,10 @@ export default class WebpackBundler extends Plugin implements Bundler {
188
188
this . babelRule ( stagingDir ) ,
189
189
{
190
190
test : / \. c s s $ / i,
191
- use : [ 'eai-style-loader' , 'eai-css-loader' ] ,
191
+ use : [
192
+ { loader : 'eai-style-loader' , options : [ ...this . opts . packages ] . find ( pkg => pkg . styleLoaderOptions ) } ,
193
+ { loader : 'eai-css-loader' , options : [ ...this . opts . packages ] . find ( pkg => pkg . cssLoaderOptions ) } ,
194
+ ] ,
192
195
} ,
193
196
] ,
194
197
} ,
You can’t perform that action at this time.
0 commit comments