File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ let pluginOptions: PluginOptions;
3535 * @returns the preprocessor markup
3636 */
3737const markup : MarkupPreprocessor = async ( { content, filename } ) => {
38- const isIncluded = filename ? isFileIncluded ( pluginOptions . includePaths , filename ) : false ;
39-
40- if ( ! isIncluded || ( ! pluginOptions . parseStyleTag && ! pluginOptions . parseExternalStylesheet ) ) {
38+ if (
39+ ! filename ||
40+ ! isFileIncluded ( pluginOptions . includePaths , filename ) ||
41+ ( ! pluginOptions . parseStyleTag && ! pluginOptions . parseExternalStylesheet )
42+ ) {
4143 return { code : content } ;
4244 }
45+
4346 let ast : Ast ;
4447 try {
4548 ast = parse ( content , { filename } ) ;
@@ -61,7 +64,7 @@ const markup: MarkupPreprocessor = async ({ content, filename }) => {
6164 let { mode, hashSeeder } = pluginOptions ;
6265
6366 if ( pluginOptions . parseStyleTag && hasModuleAttribute ( ast ) ) {
64- const moduleAttribute = ast . css . attributes . find ( ( item ) => item . name === 'module' ) ;
67+ const moduleAttribute = ast . css ? .attributes . find ( ( item ) => item . name === 'module' ) ;
6568 mode = moduleAttribute . value !== true ? moduleAttribute . value [ 0 ] . data : mode ;
6669 }
6770
You can’t perform that action at this time.
0 commit comments