Skip to content

Commit abab2a0

Browse files
committed
add possibility to change node dirname option dynamically
1 parent 0d96782 commit abab2a0

File tree

3 files changed

+8274
-2
lines changed

3 files changed

+8274
-2
lines changed

src/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
externals: ["knex", "sharp"],
2727
// Set default file extensions to use the raw-loader with
2828
rawFileExtensions: ["pem", "txt"],
29-
sourceType: "module" // "script" | "module" | "unambiguous"
29+
sourceType: "module", // "script" | "module" | "unambiguous"
30+
nodeDirname: false
3031
}
3132
};

src/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const forceExclude = config.options.forceExclude;
3737
const ignorePackages = config.options.ignorePackages;
3838
const rawFileExtensions = config.options.rawFileExtensions;
3939
const sourceType = config.options.sourceType;
40+
const nodeDirname = config.options.nodeDirname;
4041
const fixPackages = convertListToObject(config.options.fixPackages);
4142
const tsConfigPath = path.resolve(servicePath, config.options.tsConfig);
4243

@@ -438,6 +439,6 @@ module.exports = ignoreWarmupPlugin({
438439
{ minimize: false },
439440
plugins: plugins(),
440441
node: {
441-
__dirname: false
442+
__dirname: nodeDirname
442443
}
443444
});

0 commit comments

Comments
 (0)