JSPM

rollup-plugin-virtual

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16402
  • Score
    100M100P100Q40439F
  • License MIT

Load modules from memory

Package Exports

  • rollup-plugin-virtual

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rollup-plugin-virtual) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rollup-plugin-virtual

Load modules from memory.

Usage

Suppose you have an input file like this, and you want to load foo and src/bar.js from memory:

// src.main.js
import foo from 'foo';
import bar from './bar.js';

console.log(foo, bar);
// rollup.config.js
import virtual from 'rollup-plugin-virtual';

export default {
  entry: 'src/main.js',
  // ...
  plugins: [
    virtual({
      'foo': 'export default 1',
      'src/bar.js': 'export default 2'
    })
  ]
};

License

MIT