Skip to content

Commit b174e55

Browse files
authored
fix if not filename
1 parent 4001726 commit b174e55

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/hbs-imports-babel-plugin.ts

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = function hbsImports({ types: t }: { types: BabelTypes}) {
2424
ImportProcessor.options = Object.assign({}, state.opts);
2525
// @ts-ignore
2626
const fileName = path.hub.file.opts.filename;
27+
if (!fileName) return;
2728
if (fileName.includes('embroider')) {
2829
const parts = fileName.split('/');
2930
const index = parts.indexOf('embroider');
@@ -35,6 +36,7 @@ module.exports = function hbsImports({ types: t }: { types: BabelTypes}) {
3536
exit(path, state) {
3637
// @ts-ignore
3738
const fileName = path.hub.file.opts.filename;
39+
if (!fileName) return;
3840
const importedStyles = allImports && [...allImports.others]
3941
.filter(x => x.endsWith('.scss'))
4042
.map(x => x.replace(new RegExp('^'+ImportProcessor.options.namespace + '\/'), ''))

0 commit comments

Comments
 (0)