File tree 3 files changed +34
-0
lines changed
3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ import SVG from './commented.svg' ;
2
+
3
+ export function MyFunctionIcon ( ) {
4
+ return < SVG /> ;
5
+ }
6
+
7
+ export class MyClassIcon extends React . Component {
8
+ render ( ) {
9
+ return < SVG /> ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -187,3 +187,25 @@ transformFile('test/fixtures/test-export-all-as.jsx', {
187
187
if ( err ) throw err ;
188
188
console . log ( 'test/fixtures/test-export-all-as.jsx' , result . code ) ;
189
189
} ) ;
190
+
191
+ transformFile ( 'test/fixtures/test-commented.jsx' , {
192
+ presets : [ 'airbnb' ] ,
193
+ plugins : [
194
+ inlineReactSvgPlugin ,
195
+ ] ,
196
+ } , ( err , result ) => {
197
+ if ( err ) throw err ;
198
+ console . log ( 'test/fixtures/test-commented.jsx' , result . code ) ;
199
+ } ) ;
200
+
201
+ /* TODO: uncomment if babel fixes its parsing for SVGs
202
+ transformFile('test/fixtures/test-commented.jsx', {
203
+ presets: ['airbnb'],
204
+ plugins: [
205
+ [inlineReactSvgPlugin, { svgo: false }],
206
+ ],
207
+ }, (err, result) => {
208
+ if (err) throw err;
209
+ console.log('test/fixtures/test-commented.jsx', result.code);
210
+ });
211
+ */
You can’t perform that action at this time.
0 commit comments