@garfish/es-module
TypeScript icon, indicating that this package has built-in type declarations

1.17.6 • Public • Published

@garfish/es-module

NPM version

Inspired by virtual-es-module.

Usage

import Runtime from '@garfish/es-module';
// One runtime, one project
const runtime = new Runtime();

const module = await runtime.importByUrl('./a.mjs');
console.log(module);

const module = await runtime.importByCode(`
  import * as m from './a.mjs';
  export default 1;
`);
console.log(module);

Use in Garfish

@garfish/es-module will bring serious above-the-fold performance problems, child applications should not use esModule in production environments.

import { GarfishEsModule } from '@garfish/es-module';

Garfish.run({
  ...
  plugins: [
    ...
    GarfishEsModule({
      excludes: ['appName'],
    }),
  ],
})

Readme

Keywords

Package Sidebar

Install

npm i @garfish/es-module

Weekly Downloads

16

Version

1.17.6

License

MIT

Unpacked Size

106 kB

Total Files

6

Last publish

Collaborators

  • reothues
  • aishiguang
  • cttrevor
  • shawzhou
  • jiadi0801
  • jsongo
  • rustle
  • zengkp