-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
22 changed files
with
835 additions
and
66 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
4 changes: 4 additions & 0 deletions
4
crates/compiler/tests/fixtures/tree_shake/import-glob-eager/dep.ts
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,4 @@ | ||
|
||
export const routes = import.meta.glob('./modules/*.ts', { | ||
eager: true, | ||
}) |
3 changes: 3 additions & 0 deletions
3
crates/compiler/tests/fixtures/tree_shake/import-glob-eager/index.ts
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,3 @@ | ||
import { routes } from './dep' | ||
|
||
console.log(routes) |
18 changes: 18 additions & 0 deletions
18
crates/compiler/tests/fixtures/tree_shake/import-glob-eager/modules/dep.ts
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,18 @@ | ||
export default { | ||
path: "/vue-flow", | ||
redirect: "/vue-flow/index", | ||
meta: { | ||
icon: "ep:set-up", | ||
title: "vue-flow", | ||
}, | ||
children: [ | ||
{ | ||
path: "/vue-flow/index", | ||
name: "VueFlow", | ||
meta: { | ||
title: "vue-flow", | ||
extraIcon: "IF-pure-iconfont-new svg" | ||
} | ||
} | ||
] | ||
} |
62 changes: 62 additions & 0 deletions
62
crates/compiler/tests/fixtures/tree_shake/import-glob-eager/output.js
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,62 @@ | ||
//index.js: | ||
(globalThis || window || global)['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};(function(r,e){var t={};function n(r){return Promise.resolve(o(r))}function o(e){if(t[e])return t[e].exports;var i={id:e,exports:{}};t[e]=i;r[e](i,i.exports,o,n);return i.exports}o(e)})({"d2214aaa":function (module, exports, farmRequire, farmDynamicRequire) { | ||
console.log("runtime/index.js")(globalThis || window || global)["__farm_default_namespace__"].__farm_module_system__.setPlugins([]); | ||
} | ||
,},"d2214aaa");(function(_){for(var r in _){_[r].__farm_resource_pot__='index_de21.js';(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "routes", { | ||
enumerable: true, | ||
get: function() { | ||
return routes; | ||
} | ||
}); | ||
var _interop_require_wildcard = farmRequire("@swc/helpers/_/_interop_require_wildcard"); | ||
var _depts = _interop_require_wildcard._(farmRequire("edfa0cee")); | ||
const routes = { | ||
"./modules/dep.ts": _depts | ||
}; | ||
} | ||
, | ||
"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _dep = farmRequire("05ee5ec7"); | ||
console.log(_dep.routes); | ||
} | ||
, | ||
"edfa0cee":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "default", { | ||
enumerable: true, | ||
get: function() { | ||
return _default; | ||
} | ||
}); | ||
var _default = { | ||
path: "/vue-flow", | ||
redirect: "/vue-flow/index", | ||
meta: { | ||
icon: "ep:set-up", | ||
title: "vue-flow" | ||
}, | ||
children: [ | ||
{ | ||
path: "/vue-flow/index", | ||
name: "VueFlow", | ||
meta: { | ||
title: "vue-flow", | ||
extraIcon: "IF-pure-iconfont-new svg" | ||
} | ||
} | ||
] | ||
}; | ||
} | ||
,});(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap({ });var farmModuleSystem = (globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); |
Empty file.
26 changes: 26 additions & 0 deletions
26
crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/dep.mjs
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,26 @@ | ||
function $e() { | ||
return { | ||
seed: (e) => { | ||
return e; | ||
} | ||
} | ||
} | ||
|
||
|
||
var F = class { | ||
constructor(e = {}){ | ||
let { randomizer: r = $e() } = e; | ||
this._randomizer = r; | ||
} | ||
get defaultRefDate() { | ||
return this._defaultRefDate; | ||
} | ||
setDefaultRefDate(e = ()=>new Date) { | ||
typeof e == "function" ? this._defaultRefDate = e : this._defaultRefDate = ()=>new Date(e); | ||
} | ||
seed(e = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER)) { | ||
return this._randomizer.seed(e), e; | ||
} | ||
}, Yt = new F; | ||
|
||
export { F as default, Yt as R }; |
4 changes: 4 additions & 0 deletions
4
crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/index.ts
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,4 @@ | ||
import Dep from "./dep.mjs"; | ||
import { useFullscreen, document1 } from "./object-assign.mjs"; | ||
|
||
console.log(Dep, useFullscreen, document1); |
19 changes: 19 additions & 0 deletions
19
crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/object-assign.mjs
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,19 @@ | ||
const defaultDocument = globalThis.isClient ? window.document : undefined; | ||
const defaultWindow = globalThis.isClient ? window : undefined; | ||
const F = {}; | ||
|
||
function useFullscreen(target, options = {}) { | ||
const { | ||
document = defaultDocument, | ||
autoExit = false | ||
} = options; | ||
|
||
return document; | ||
} | ||
|
||
const { document: { document1 } = defaultWindow.document } = F; | ||
|
||
export { | ||
useFullscreen, | ||
document1 | ||
} |
79 changes: 79 additions & 0 deletions
79
crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/output.js
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,79 @@ | ||
//index.js: | ||
(globalThis || window || global)['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};(function(r,e){var t={};function n(r){return Promise.resolve(o(r))}function o(e){if(t[e])return t[e].exports;var i={id:e,exports:{}};t[e]=i;r[e](i,i.exports,o,n);return i.exports}o(e)})({"ec853507":function (module, exports, farmRequire, farmDynamicRequire) { | ||
console.log("runtime/index.js")(globalThis || window || global)["__farm_default_namespace__"].__farm_module_system__.setPlugins([]); | ||
} | ||
,},"ec853507");(function(_){for(var r in _){_[r].__farm_resource_pot__='index_f1d9.js';(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"4312d062":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "default", { | ||
enumerable: true, | ||
get: function() { | ||
return F; | ||
} | ||
}); | ||
function $e() { | ||
return { | ||
seed: (e)=>{ | ||
return e; | ||
} | ||
}; | ||
} | ||
var F = class { | ||
constructor(e = {}){ | ||
let { randomizer: r = $e() } = e; | ||
this._randomizer = r; | ||
} | ||
get defaultRefDate() { | ||
return this._defaultRefDate; | ||
} | ||
setDefaultRefDate(e = ()=>new Date) { | ||
typeof e == "function" ? this._defaultRefDate = e : this._defaultRefDate = ()=>new Date(e); | ||
} | ||
seed(e = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER)) { | ||
return this._randomizer.seed(e), e; | ||
} | ||
}, Yt = new F; | ||
} | ||
, | ||
"81077a1f":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
document1: function() { | ||
return document1; | ||
}, | ||
useFullscreen: function() { | ||
return useFullscreen; | ||
} | ||
}); | ||
const defaultDocument = globalThis.isClient ? window.document : undefined; | ||
const defaultWindow = globalThis.isClient ? window : undefined; | ||
const F = {}; | ||
function useFullscreen(target, options = {}) { | ||
const { document = defaultDocument, autoExit = false } = options; | ||
return document; | ||
} | ||
const { document: { document1 } = defaultWindow.document } = F; | ||
} | ||
, | ||
"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _interop_require_default = farmRequire("@swc/helpers/_/_interop_require_default"); | ||
var _dep = _interop_require_default._(farmRequire("4312d062")); | ||
var _objectassign = farmRequire("81077a1f"); | ||
console.log(_dep.default, _objectassign.useFullscreen, _objectassign.document1); | ||
} | ||
,});(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);(globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap({ });var farmModuleSystem = (globalThis || window || global)['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); |
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
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
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
Oops, something went wrong.