mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-21 14:13:36 +08:00
docs:更新文档
This commit is contained in:
200
node_modules/rollup-plugin-dynamic-import-variables/test/snapshots/rollup-plugin-dynamic-import-variables.js.md
generated
vendored
Normal file
200
node_modules/rollup-plugin-dynamic-import-variables/test/snapshots/rollup-plugin-dynamic-import-variables.js.md
generated
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
# Snapshot report for `test/rollup-plugin-dynamic-import-variables.js`
|
||||
|
||||
The actual snapshot is saved in `rollup-plugin-dynamic-import-variables.js.snap`.
|
||||
|
||||
Generated by [AVA](https://ava.li).
|
||||
|
||||
## can exclude files
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function importModule(name) {␊
|
||||
return import(`./module-dir-a/${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## complex concatenation
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
case './module-dir-b/module-b-1.js': return import('./module-b-1-72e7a68a.js');␊
|
||||
case './module-dir-b/module-b-2.js': return import('./module-b-2-4b67cae0.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(dirName, name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./${`module-dir-${dirName}`}` + '/' + name + '.js');␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## doesn't change imports that should not be changed
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`console.log("a-1");␊
|
||||
␊
|
||||
function importModuleA() {␊
|
||||
return import('./module-a-2-173cc5f5.js');␊
|
||||
}␊
|
||||
␊
|
||||
function importModuleB() {␊
|
||||
return import('./' + 'module-dir-a' + '/' + 'module-a-2' + '.js');␊
|
||||
}␊
|
||||
␊
|
||||
export { importModuleA, importModuleB };␊
|
||||
`
|
||||
|
||||
## multiple dirs
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
case './module-dir-b/module-b-1.js': return import('./module-b-1-72e7a68a.js');␊
|
||||
case './module-dir-b/module-b-2.js': return import('./module-b-2-4b67cae0.js');␊
|
||||
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-89accf3a.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(dir, name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./${dir}/${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## multiple dynamic imports
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime2__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
case './module-dir-b/module-b-1.js': return import('./module-b-1-72e7a68a.js');␊
|
||||
case './module-dir-b/module-b-2.js': return import('./module-b-2-4b67cae0.js');␊
|
||||
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-89accf3a.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function __variableDynamicImportRuntime1__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
class Foo {␊
|
||||
importModule(name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./module-dir-a/${name}.js`);␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
__variableDynamicImportRuntime1__(`./module-dir-a/${name}.js`).then((module) => {␊
|
||||
console.log('imported', module);␊
|
||||
});␊
|
||||
␊
|
||||
function importModuleFromDir(dir, name) {␊
|
||||
return __variableDynamicImportRuntime2__(`./${dir}/${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { Foo, importModuleFromDir };␊
|
||||
`
|
||||
|
||||
## own directory
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './root-module-a.js': return import('./root-module-a-0cd41d7c.js');␊
|
||||
case './root-module-b.js': return import('./root-module-b-decca893.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./root-module-${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## single dir
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./module-dir-a/${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## upwards dir path
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case '../module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case '../module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(name) {␊
|
||||
return __variableDynamicImportRuntime0__(`../module-dir-a/${name}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
|
||||
## CallExpression
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`function __variableDynamicImportRuntime0__(path) {␊
|
||||
switch (path) {␊
|
||||
case './module-dir-a/module-a-1.js': return import('./module-a-1-80325d58.js');␊
|
||||
case './module-dir-a/module-a-2.js': return import('./module-a-2-173cc5f5.js');␊
|
||||
default: return Promise.reject(new Error("Unknown variable dynamic import: " + path));␊
|
||||
}␊
|
||||
}␊
|
||||
␊
|
||||
function importModule(dirName, name) {␊
|
||||
return __variableDynamicImportRuntime0__(`./module-dir-a/${name.substring(0, 2)}.js`);␊
|
||||
}␊
|
||||
␊
|
||||
export { importModule };␊
|
||||
`
|
||||
BIN
node_modules/rollup-plugin-dynamic-import-variables/test/snapshots/rollup-plugin-dynamic-import-variables.js.snap
generated
vendored
Normal file
BIN
node_modules/rollup-plugin-dynamic-import-variables/test/snapshots/rollup-plugin-dynamic-import-variables.js.snap
generated
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user