Skip to content

Commit

Permalink
refactoring (removed circular dependencies)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 15, 2021
1 parent 95bf58c commit 109e28c
Show file tree
Hide file tree
Showing 252 changed files with 33,390 additions and 29,405 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ tools/freetype-tools/FreeType-Emscripten

# nix build
/result*

bundle-meta.json
circular.txt
10 changes: 10 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
},
"tsx": {
"skipTypeImports": true
}
}
}
26 changes: 26 additions & 0 deletions build-dev-bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Your bundler file
const esbuild = require("esbuild");
const { nodeExternalsPlugin } = require("esbuild-node-externals");
const fs = require("fs");

// esbuild packages/home/main.tsx --bundle --sourcemap --metafile=meta.json --platform=node --target=node14.6
// --external:node-ensure --external:better-sqlite3 --external:electron
// --outfile=build/home/main.js

(async () => {
const result = await esbuild.build({
entryPoints: ["packages/home/main.tsx"],
bundle: true,
sourcemap: true,
metafile: true,
platform: "node",
target: "node14.6",
outfile: "build/home/main.js",
external: ["node-ensure", "fs", "net", "electron"],
plugins: [nodeExternalsPlugin()]
});

fs.writeFileSync("bundle-meta.json", JSON.stringify(result, undefined, 4), {
encoding: "utf8"
});
})();
31 changes: 31 additions & 0 deletions build-release-bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Your bundler file
const esbuild = require("esbuild");
const { nodeExternalsPlugin } = require("esbuild-node-externals");
const fs = require("fs");

// esbuild packages/home/main.tsx --bundle --sourcemap --metafile=meta.json --platform=node --target=node14.6
// --external:node-ensure --external:better-sqlite3 --external:electron
// --outfile=build/home/main.js

esbuild.build({
entryPoints: ["packages/home/main.tsx"],
bundle: true,
sourcemap: false,
metafile: false,
minify: true,
platform: "node",
target: "node14.6",
outfile: "build/home/main.js",
external: [
"node-ensure",
"fs",
"net",
"electron",
"better-sqlite3",
"mobx",
"react",
"react-dom",
"mobx-react"
],
plugins: [nodeExternalsPlugin()]
});
File renamed without changes.
Loading

0 comments on commit 109e28c

Please sign in to comment.