Skip to content

Commit

Permalink
fix: update component paths on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisonian committed Apr 15, 2022
1 parent 0a81e4b commit 047111a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions packages/idyll-cli/src/node-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = (paths, opts) => {
debug('Reading components from directories:', transformFolders);

const originalLoad = Module._load;
const isWindows = os.platform().includes('win');
Module._load = function(path) {
switch (path) {
case 'react':
Expand All @@ -25,12 +24,4 @@ module.exports = (paths, opts) => {
return originalLoad.apply(Module, arguments);
}
};

if (opts.transformComponents) {
require('@babel/register')({
presets: ['@babel/env', '@babel/preset-react'],
babelrc: false,
only: isWindows ? undefined : transformFolders
});
}
};
2 changes: 1 addition & 1 deletion packages/idyll-cli/src/pipeline/create-js-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var ast = ${JSON.stringify(ast)};
${components
.map(([k, p], i) => {
return `import _component_${i} from '${p}'`;
return `import _component_${i} from '${p.replace(/\\/g, '\\\\')}'`;
})
.join('\n')}
Expand Down

0 comments on commit 047111a

Please sign in to comment.