-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule excalidraw
added at
b7d7cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/src/packages/excalidraw/main.js b/src/packages/excalidraw/main.js | ||
index 853bb70f..45883611 100644 | ||
--- a/src/packages/excalidraw/main.js | ||
+++ b/src/packages/excalidraw/main.js | ||
@@ -1,11 +1 @@ | ||
-if (process.env.IS_PREACT === "true") { | ||
- if (process.env.NODE_ENV === "production") { | ||
- module.exports = require("./dist/excalidraw-with-preact.production.min.js"); | ||
- } else { | ||
- module.exports = require("./dist/excalidraw-with-preact.development.js"); | ||
- } | ||
-} else if (process.env.NODE_ENV === "production") { | ||
- module.exports = require("./dist/excalidraw.production.min.js"); | ||
-} else { | ||
- module.exports = require("./dist/excalidraw.development.js"); | ||
-} | ||
+module.exports = require("./dist/excalidraw.production.min.js"); | ||
diff --git a/src/packages/excalidraw/webpack.prod.config.js b/src/packages/excalidraw/webpack.prod.config.js | ||
index 0a2d7faa..01eaf8be 100644 | ||
--- a/src/packages/excalidraw/webpack.prod.config.js | ||
+++ b/src/packages/excalidraw/webpack.prod.config.js | ||
@@ -96,13 +96,11 @@ module.exports = { | ||
test: /\.js($|\?)/i, | ||
}), | ||
], | ||
+ runtimeChunk: false, | ||
splitChunks: { | ||
chunks: "async", | ||
cacheGroups: { | ||
- vendors: { | ||
- test: /[\\/]node_modules[\\/]/, | ||
- name: "vendor", | ||
- }, | ||
+ default: false, | ||
}, | ||
}, | ||
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ | |
|
||
base-pkgs = with pkgs; [ | ||
bun | ||
yarn | ||
nodejs_latest | ||
pandoc | ||
pandoc-norg-rs.packages.${system}.default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { spawnSync } from "node:child_process"; | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
export const project_root = path.join(__dirname, ".."); | ||
|
||
const excalidrawDir = path.join(project_root, "excalidraw"); | ||
const excalidrawPkgDir = path.join(excalidrawDir, "src/packages/excalidraw"); | ||
|
||
const gitRevCheck = spawnSync( | ||
"git", | ||
[ | ||
"apply", | ||
"--reverse", | ||
"--check", | ||
path.join(project_root, "excalidraw.patch"), | ||
], | ||
{ | ||
cwd: excalidrawDir, | ||
}, | ||
); | ||
|
||
if (gitRevCheck.status != 0) { | ||
spawnSync("git", ["apply", path.join(project_root, "excalidraw.patch")], { | ||
cwd: excalidrawDir, | ||
stdio: "inherit", | ||
}); | ||
} else { | ||
console.error("Excalidraw patch already applied"); | ||
} | ||
|
||
let res = spawnSync("yarn", ["--frozen-lockfile"], { | ||
stdio: "inherit", | ||
cwd: excalidrawDir, | ||
}); | ||
|
||
if (res.error) throw res.error; | ||
|
||
res = spawnSync("yarn", ["--frozen-lockfile"], { | ||
stdio: "inherit", | ||
cwd: excalidrawPkgDir, | ||
}); | ||
|
||
if (res.error) throw res.error; | ||
|
||
res = spawnSync("rm", ["-rf", "dist"], { | ||
stdio: "inherit", | ||
cwd: excalidrawPkgDir, | ||
}); | ||
|
||
if (res.error) throw res.error; | ||
|
||
res = spawnSync("yarn", ["webpack", "--config", "webpack.prod.config.js"], { | ||
stdio: "inherit", | ||
cwd: excalidrawPkgDir, | ||
env: { | ||
NODE_ENV: "production", | ||
}, | ||
}); | ||
|
||
if (res.error) throw res.error; | ||
|
||
res = spawnSync("bun", ["install", "--ignore-scripts", "--frozen-lockfile"], { | ||
stdio: "inherit", | ||
}); | ||
|
||
if (res.error) throw res.error; |