File tree 4 files changed +33
-8
lines changed
4 files changed +33
-8
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ export default function ( ) {
10
+ return `export default '';` ;
11
+ }
Original file line number Diff line number Diff line change @@ -232,14 +232,16 @@ export async function execute(
232
232
} ,
233
233
} ) ;
234
234
235
- // Replace all stylesheets with an empty default export
235
+ // Replace all stylesheets with empty content
236
236
partials . push ( {
237
- plugins : [
238
- new webpack . NormalModuleReplacementPlugin (
239
- / \. ( c s s | s c s s | s a s s | s t y l | l e s s ) $ / ,
240
- path . join ( __dirname , 'empty-export-default.js' ) ,
241
- ) ,
242
- ] ,
237
+ module : {
238
+ rules : [
239
+ {
240
+ test : / \. ( c s s | s c s s | s a s s | s t y l | l e s s ) $ / ,
241
+ loader : require . resolve ( './empty-loader' ) ,
242
+ } ,
243
+ ] ,
244
+ } ,
243
245
} ) ;
244
246
245
247
return partials ;
Original file line number Diff line number Diff line change @@ -146,4 +146,17 @@ describe('Extract i18n Target', () => {
146
146
const fullLog = logs . join ( ) ;
147
147
expect ( fullLog ) . toContain ( 'Duplicate messages with id' ) ;
148
148
} ) ;
149
+
150
+ it ( 'ignores inline styles' , async ( ) => {
151
+ host . appendToFile ( 'src/app/app.component.html' , '<p i18n>i18n test</p>' ) ;
152
+ host . replaceInFile ( 'src/app/app.component.ts' , 'styleUrls' , 'styles' ) ;
153
+ host . replaceInFile ( 'src/app/app.component.ts' , './app.component.css' , 'h1 { color: green; }' ) ;
154
+
155
+ const run = await architect . scheduleTarget ( extractI18nTargetSpec ) ;
156
+
157
+ // This will fail if a style is processed since the style rules are not included during extraction
158
+ await expectAsync ( run . result ) . toBeResolvedTo ( jasmine . objectContaining ( { success : true } ) ) ;
159
+
160
+ await run . stop ( ) ;
161
+ } ) ;
149
162
} ) ;
You can’t perform that action at this time.
0 commit comments