Skip to content

Commit 4033a07

Browse files
committed
fix windows
1 parent 953669d commit 4033a07

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/hbs-imports-babel-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function hbsImports({ types: t }: { types: BabelTypes}) {
2222
let cwd = process.cwd();
2323
ImportProcessor.options = Object.assign({}, state.opts);
2424
// @ts-ignore
25-
const fileName = path.hub.file.opts.filename;
25+
const fileName = path.hub.file.opts.filename.replace(/\\/g, '/');
2626
if (!fileName) return;
2727
if (fileName.includes('embroider')) {
2828
const parts = fileName.split('/');

lib/import-processor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const importProcessors = {
118118
relativePath = relativePath.replace(/^app\//, this.options.root + '/');
119119
relativePath = relativePath.replace(/^addon\//, this.options.root + '/');
120120
relativePath = relativePath.replace(/^src\//, this.options.root + '/');
121-
importPath = path.join(path.dirname(relativePath), importPath).split(path.sep).join('/');
121+
importPath = path.resolve(path.dirname(relativePath), importPath).split(path.sep).join('/');
122122
importPath = importPath.replace('node_modules/', '');
123123
// fix for missing app namespace in embroider
124124
if (!importPath.startsWith(this.options.namespace)) {

0 commit comments

Comments
 (0)