Skip to content

Commit

Permalink
fix(regression): Webpack not working on Windows with new export registry
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin authored Jul 27, 2023
1 parent 3593d53 commit c80220a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js-packages/webpack-config/src/autoExportLoader.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ module.exports = function autoExportLoader(source) {
// Get the path of the module to be exported
// relative to the src directory.
// Example: src/forum/components/UserCard.js => forum/components
const pathToModule = this.resourcePath.replace(path.resolve(this.rootContext, 'src') + '/', '').replace(/[A-Za-z_]+\.[A-Za-z_]+$/, '');
const pathToModule = path.relative(path.resolve(this.rootContext, 'src'), this.resourcePath)
.replaceAll(path.sep, '/')
.replace(/[A-Za-z_]+\.[A-Za-z_]+$/, '');

return addAutoExports(source, pathToModule, moduleName);
};

0 comments on commit c80220a

Please sign in to comment.