1 | const path = require("path");
|
2 | const fs = require("fs-extra");
|
3 |
|
4 | module.exports = function () {
|
5 | fs.copySync(this.resourcePath, path.resolve(this._compiler.options.output.path, path.relative(process.cwd(), this.resourcePath)));
|
6 | return `
|
7 | try {
|
8 | global.process.dlopen(module, './${path.relative(process.cwd(), this.resourcePath).replace(/\\/g, "/")}');
|
9 | } catch(e) {
|
10 | throw new Error('Cannot open ./${path.relative(process.cwd(), this.resourcePath).replace(/\\/g, "/")}: ' + e);
|
11 | }`.trim();
|
12 | };
|