07-21-2023, 03:29 PM
Can I have absolute paths with forward slashes in windows in nodejs? I am using something like this :
global.__base = __dirname + '/';
var Article = require(__base + 'app/models/article');
But on windows the build is failing as it is requiring something like `C:\Something\Something/apps/models/article`. I aam using webpack. So how to circumvent this issue so that the requiring remains the same i.e. `__base + 'app/models/src'`?
global.__base = __dirname + '/';
var Article = require(__base + 'app/models/article');
But on windows the build is failing as it is requiring something like `C:\Something\Something/apps/models/article`. I aam using webpack. So how to circumvent this issue so that the requiring remains the same i.e. `__base + 'app/models/src'`?