mirror of
https://github.com/flarum/core.git
synced 2025-08-05 16:07:34 +02:00
fix(regression): Webpack not working on Windows with new export registry
This commit is contained in:
committed by
GitHub
parent
3593d53795
commit
c80220ad9b
@@ -179,7 +179,9 @@ module.exports = function autoExportLoader(source) {
|
|||||||
// Get the path of the module to be exported
|
// Get the path of the module to be exported
|
||||||
// relative to the src directory.
|
// relative to the src directory.
|
||||||
// Example: src/forum/components/UserCard.js => forum/components
|
// 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);
|
return addAutoExports(source, pathToModule, moduleName);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user