Skip to content

Commit

Permalink
fix if not filename
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Oct 17, 2023
1 parent 4001726 commit b174e55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/hbs-imports-babel-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = function hbsImports({ types: t }: { types: BabelTypes}) {
ImportProcessor.options = Object.assign({}, state.opts);
// @ts-ignore
const fileName = path.hub.file.opts.filename;
if (!fileName) return;
if (fileName.includes('embroider')) {
const parts = fileName.split('/');
const index = parts.indexOf('embroider');
Expand All @@ -35,6 +36,7 @@ module.exports = function hbsImports({ types: t }: { types: BabelTypes}) {
exit(path, state) {
// @ts-ignore
const fileName = path.hub.file.opts.filename;
if (!fileName) return;
const importedStyles = allImports && [...allImports.others]
.filter(x => x.endsWith('.scss'))
.map(x => x.replace(new RegExp('^'+ImportProcessor.options.namespace + '\/'), ''))
Expand Down

0 comments on commit b174e55

Please sign in to comment.