Build: Fix build script for next branch (#12483)
This commit is contained in:
1 parent
e97316ac5d
commit
9b2dc0e4e6
3 files changed
+12
-7
No files matched your search
@@ -30,9 +30,10 @@ To reduce the bundle size, replace the entry with smaller files.
|
||||
|
||||
We can switch to deep require once https://github.com/kpdecker/jsdiff/pull/351 get merged
|
||||
*/
|
||||
const diffPackageDirectory = path.dirname(require.resolve("diff/package.json"));
|
||||
const replaceDiffPackageEntry = (file) => ({
|
||||
[require.resolve("diff")]: path.join(
|
||||
path.dirname(require.resolve("diff/package.json")),
|
||||
[path.join(diffPackageDirectory, "lib/index.mjs")]: path.join(
|
||||
diffPackageDirectory,
|
||||
file
|
||||
),
|
||||
});
|
||||
|
||||
@@ -29,7 +29,11 @@ export default function esbuildPluginReplaceModule(replacements = {}) {
|
||||
|
||||
build.onResolve({ filter: /./ }, async (args) => {
|
||||
if (
|
||||
!(args.kind === "require-call" || args.kind === "import-statement") ||
|
||||
!(
|
||||
args.kind === "require-call" ||
|
||||
args.kind === "import-statement" ||
|
||||
args.kind === "dynamic-import"
|
||||
) ||
|
||||
args.namespace !== "file"
|
||||
) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user