rollup-plugin-virtual

Load modules from memory

This package has been deprecated and is no longer maintained. Please use @rollup/plugin-virtual.
Last updated 3 years ago by rich_harris .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-virtual 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1 [deprecated]           ...           3 years ago
  • 1.0.0 [deprecated]           ...           3 years ago

Copyright 2014 - 2016 © taobao.org |