Archived
1
0

Fix readdir for root path (#35)

* Fix readdir for root path

* Fix merge of webpack conf

* Fix travis.yml to deploy on master

* Remove windows platform from travis.yml

* Enable caching

* mkdirpSync

* Fix build script
This commit is contained in:
Kyle Carberry
2019-02-25 16:29:34 -06:00
committed by Asher
parent eaea947318
commit 0c2c957312
8 changed files with 84 additions and 42 deletions

View File

@ -2,6 +2,16 @@ const fs = require("fs");
const fse = require("fs-extra");
const os = require("os");
const path = require("path");
const nexePath = require.resolve("nexe");
const shimPath = path.join(path.dirname(nexePath), "lib/steps/shim.js");
let shimContent = fs.readFileSync(shimPath).toString();
const replaceString = `global.nativeFs = { readdir: originalReaddir, readdirSync: originalReaddirSync };`;
shimContent = shimContent.replace(/compiler\.options\.resources\.length[\s\S]*wrap\("(.*\\n)"/g, (om, a) => {
return om.replace(a, `${a}${replaceString}`);
});
fs.writeFileSync(shimPath, shimContent);
const nexe = require("nexe");
nexe.compile({
@ -13,7 +23,7 @@ nexe.compile({
* To include native extensions, do NOT install node_modules for each one. They
* are not required as each extension is built using webpack.
*/
resources: [
resources: [
path.join(__dirname, "../package.json"),
path.join(__dirname, "../build/**/*"),
],