Skip to content

Commit d27827c

Browse files
committed
add possibility to preserve __dirname
1 parent 38c9c47 commit d27827c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/config.js

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

src/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const forceExclude = config.options.forceExclude;
3535
const ignorePackages = config.options.ignorePackages;
3636
const rawFileExtensions = config.options.rawFileExtensions;
3737
const sourceType = config.options.sourceType;
38+
const nodeDirname = config.options.nodeDirname;
3839
const fixPackages = convertListToObject(config.options.fixPackages);
3940
const tsConfigPath = path.resolve(servicePath, config.options.tsConfig);
4041

@@ -371,6 +372,6 @@ module.exports = ignoreWarmupPlugin({
371372
{ minimize: false },
372373
plugins: plugins(),
373374
node: {
374-
__dirname: false
375+
__dirname: nodeDirname
375376
}
376377
});

0 commit comments

Comments
 (0)