@genee/pico

2.0.0 • Public • Published

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) => {

});

Readme

Keywords

none

Package Sidebar

Install

npm i @genee/pico

Weekly Downloads

16

Version

2.0.0

License

MIT

Unpacked Size

7.54 kB

Total Files

6

Last publish

Collaborators

  • iamfat