mirror of
https://github.com/flarum/framework.git
synced 2024-11-22 11:16:39 +08:00
fix(regression): Webpack not working on Windows with new export registry
This commit is contained in:
parent
3593d53795
commit
c80220ad9b
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user