@genee/pico
v2.0.0
Published
Light-weight AMD JS loader for specific scene.
Downloads
25
Readme
pico
Light-weight AMD JS loader for specific scene...
Installation
pnpm add @genee/pico@^2
How to use it?
import { config, define, require } from 'pico';
config({
paths: {
'your-module-name': 'http://path/to/your-module.js',
},
});
config({
paths: (name) => {
return `http://path/to/${name}`;
},
});
define('YOUR_DEP_NAME1', YOUR_DEP_MODULE1);
define('YOUR_DEP_NAME2', YOUR_DEP_MODULE2);
// load some of your modules from browser-side
require(['url1', 'url2'], (module1, module2) => {
});