Skip to content

Commit

Permalink
Reduce output size
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 18, 2023
1 parent 39581c4 commit ed3e000
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions packages/babel-plugin-proposal-import-defer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ export default declare(api => {
if (payload === "defer/function") {
if (!referenced) return false;
return template.statement.ast`
function ${name}() {
const data = ${init};
function ${name}(data) {
${name} = () => data;
return data;
return data = ${init};
}
`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use strict";

function a() {
const data = babelHelpers.interopRequireWildcard(require("a"));
function a(data) {
a = () => data;
return data;
return data = babelHelpers.interopRequireWildcard(require("a"));
}
var b = babelHelpers.importDeferProxy(() => babelHelpers.interopRequireWildcard(require("b")));
function c() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use strict";

function ns() {
const data = babelHelpers.interopRequireWildcard(require("x"));
function ns(data) {
ns = () => data;
return data;
return data = babelHelpers.interopRequireWildcard(require("x"));
}
later(() => {
ns().prop;
Expand Down

0 comments on commit ed3e000

Please sign in to comment.