zjsunit: Add babel-plugin-lazy-require.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-27 11:28:33 -08:00 committed by Tim Abbott
parent 979d0777d9
commit 4df3fef88f
4 changed files with 12 additions and 2 deletions

View File

@ -23,7 +23,11 @@ require("@babel/register")({
"^" + _.escapeRegExp(path.resolve(__dirname, "../../static/shared/js") + path.sep), "^" + _.escapeRegExp(path.resolve(__dirname, "../../static/shared/js") + path.sep),
), ),
], ],
plugins: ["rewire-ts", ["@babel/plugin-transform-modules-commonjs", {lazy: () => true}]], plugins: [
"babel-plugin-lazy-require",
"babel-plugin-rewire-ts",
["@babel/plugin-transform-modules-commonjs", {lazy: () => true}],
],
}); });
// Create a helper function to avoid sneaky delays in tests. // Create a helper function to avoid sneaky delays in tests.

View File

@ -89,6 +89,7 @@
"@types/webpack-dev-server": "^3.1.6", "@types/webpack-dev-server": "^3.1.6",
"@typescript-eslint/eslint-plugin": "^4.0.1", "@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1", "@typescript-eslint/parser": "^4.0.1",
"babel-plugin-lazy-require": "^1.0.3",
"babel-plugin-rewire-ts": "^1.4.0", "babel-plugin-rewire-ts": "^1.4.0",
"difflib": "^0.2.4", "difflib": "^0.2.4",
"eslint": "^7.2.0", "eslint": "^7.2.0",

View File

@ -45,4 +45,4 @@ API_FEATURE_LEVEL = 39
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = "128.1" PROVISION_VERSION = "128.2"

View File

@ -2187,6 +2187,11 @@ babel-plugin-dynamic-import-node@^2.3.3:
dependencies: dependencies:
object.assign "^4.1.0" object.assign "^4.1.0"
babel-plugin-lazy-require@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/babel-plugin-lazy-require/-/babel-plugin-lazy-require-1.0.3.tgz#8307b3572c6546799a9ef69637da9711043b29e0"
integrity sha512-EtHlh2iB6724cpJaGNvuRwN6zkLXIA+xLKUwIqJwczT9xAA70fPv9XWs0NQKs5zkLppAT5wLn6nK6hwINXOSZg==
babel-plugin-rewire-ts@^1.4.0: babel-plugin-rewire-ts@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/babel-plugin-rewire-ts/-/babel-plugin-rewire-ts-1.4.0.tgz#6c814d5aa3ef3d8c0d0c7a27891877fb28930e5b" resolved "https://registry.yarnpkg.com/babel-plugin-rewire-ts/-/babel-plugin-rewire-ts-1.4.0.tgz#6c814d5aa3ef3d8c0d0c7a27891877fb28930e5b"