{"_id":"rollup-plugin-hypothetical","_rev":"677220","name":"rollup-plugin-hypothetical","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","dist-tags":{"latest":"2.1.1"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"time":{"modified":"2021-08-28T21:45:49.000Z","created":"2016-05-12T02:39:55.658Z","2.1.1":"2021-08-28T21:41:52.970Z","2.1.0":"2018-01-23T22:27:58.626Z","2.0.0":"2017-09-11T02:58:28.118Z","1.2.1":"2016-08-07T02:55:20.055Z","1.2.0":"2016-08-06T09:40:48.802Z","1.1.1":"2016-08-06T08:31:16.233Z","1.1.0":"2016-07-20T00:18:55.444Z","1.0.1":"2016-06-23T20:16:38.083Z","1.0.0":"2016-05-12T02:39:55.658Z"},"users":{},"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"versions":{"2.1.1":{"name":"rollup-plugin-hypothetical","version":"2.1.1","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^9.1.1","rollup":"^2.56.3"},"gitHead":"4711a04cf25b7f5ac8c60f1a544cc4078cd19c9e","_id":"rollup-plugin-hypothetical@2.1.1","_nodeVersion":"16.8.0","_npmVersion":"7.21.1","dist":{"shasum":"d2a72b2d3723707531b08124bc5009b1e426d3dd","size":3958,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-2.1.1.tgz"},"_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"directories":{},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-hypothetical_2.1.1_1630186912839_0.6864242290835536"},"_hasShrinkwrap":false,"publish_time":1630186912970,"_cnpm_publish_time":1630186912970},"2.1.0":{"name":"rollup-plugin-hypothetical","version":"2.1.0","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^5.0.0","rollup":"^0.55.0"},"gitHead":"7a4a7dd62d12cb460e5aed4d39c5efbd7a293e70","_id":"rollup-plugin-hypothetical@2.1.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"7fec9a865ed7d0eac14ca6ee2b2c4088acdb1955","size":3987,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-2.1.0.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-hypothetical-2.1.0.tgz_1516746478406_0.7697529243305326"},"directories":{},"publish_time":1516746478626,"_hasShrinkwrap":false,"_cnpm_publish_time":1516746478626},"2.0.0":{"name":"rollup-plugin-hypothetical","version":"2.0.0","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^3.2.0","rollup":"^0.49.3"},"gitHead":"b618680c1cd664886a27cb1d100363bd82714ad9","_id":"rollup-plugin-hypothetical@2.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"7257c6bd441201cbaa35bfa04fccac0eb818200d","size":3757,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-2.0.0.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-hypothetical-2.0.0.tgz_1505098708052_0.9935605567879975"},"directories":{},"publish_time":1505098708118,"_cnpm_publish_time":1505098708118,"_hasShrinkwrap":false},"1.2.1":{"name":"rollup-plugin-hypothetical","version":"1.2.1","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"bc2e4303a56e7c0311332823caeba7247ffccb4b","_id":"rollup-plugin-hypothetical@1.2.1","_shasum":"f427077b7bab592cc298197ab9aaac4fe4efa055","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.1","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"f427077b7bab592cc298197ab9aaac4fe4efa055","size":3037,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.2.1.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.2.1.tgz_1470538516872_0.03164750197902322"},"directories":{},"publish_time":1470538520055,"_cnpm_publish_time":1470538520055,"_hasShrinkwrap":false},"1.2.0":{"name":"rollup-plugin-hypothetical","version":"1.2.0","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"071b404ced94eda9e03f215e2d8f955a41a6ef72","_id":"rollup-plugin-hypothetical@1.2.0","_shasum":"91d1679c9e5787a06cc0bb19a5a13a82964c6bb2","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.1","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"91d1679c9e5787a06cc0bb19a5a13a82964c6bb2","size":3012,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.2.0.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.2.0.tgz_1470476448522_0.21095093805342913"},"directories":{},"publish_time":1470476448802,"_cnpm_publish_time":1470476448802,"_hasShrinkwrap":false},"1.1.1":{"name":"rollup-plugin-hypothetical","version":"1.1.1","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"16d65f5becc7a2844a1cc44b67685644892a9c9c","_id":"rollup-plugin-hypothetical@1.1.1","_shasum":"6159016ca8eff1cad1a95e81d7fa891b38fbc58a","_from":".","_npmVersion":"3.10.5","_nodeVersion":"6.3.1","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"6159016ca8eff1cad1a95e81d7fa891b38fbc58a","size":2883,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.1.1.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.1.1.tgz_1470472272975_0.5885182027705014"},"directories":{},"publish_time":1470472276233,"_cnpm_publish_time":1470472276233,"_hasShrinkwrap":false},"1.1.0":{"name":"rollup-plugin-hypothetical","version":"1.1.0","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"266932cf7c8b33b512a10f59e512760092b3f7fd","_id":"rollup-plugin-hypothetical@1.1.0","_shasum":"f55ba108c1063a7f9229671cd1e55e22ab0a451a","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"f55ba108c1063a7f9229671cd1e55e22ab0a451a","size":2587,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.1.0.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.1.0.tgz_1468973932936_0.17702694842591882"},"directories":{},"publish_time":1468973935444,"_cnpm_publish_time":1468973935444,"_hasShrinkwrap":false},"1.0.1":{"name":"rollup-plugin-hypothetical","version":"1.0.1","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","engines":{"node":">=0.12"},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"c546663a7abbbef8f8c5cd1047b3309c66dc4ddf","_id":"rollup-plugin-hypothetical@1.0.1","_shasum":"2662aaa3ec9f22425f5401d11e00d2c609e036dc","_from":".","_npmVersion":"2.15.1","_nodeVersion":"0.12.14","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"2662aaa3ec9f22425f5401d11e00d2c609e036dc","size":2681,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.0.1.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.0.1.tgz_1466712993809_0.9486189014278352"},"directories":{},"publish_time":1466712998083,"_cnpm_publish_time":1466712998083,"_hasShrinkwrap":false},"1.0.0":{"name":"rollup-plugin-hypothetical","version":"1.0.0","description":"gives Rollup an imaginary file system, e.g. for testing other plugins","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/Permutatrix/rollup-plugin-hypothetical.git"},"keywords":["rollup-plugin"],"author":{"name":"Permutator","email":"permutatorem@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","devDependencies":{"mocha":"^2.4.5","rollup":"^0.26.2"},"gitHead":"62ad8906a9e1f16e05f7fc4b701127be3378916c","_id":"rollup-plugin-hypothetical@1.0.0","_shasum":"ac0239c22899f39fc668be5bc4d4a5e3ab0377a0","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.1.0","_npmUser":{"name":"permutator","email":"permutatorem@gmail.com"},"dist":{"shasum":"ac0239c22899f39fc668be5bc4d4a5e3ab0377a0","size":1815,"noattachment":false,"key":"/rollup-plugin-hypothetical/-/rollup-plugin-hypothetical-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-hypothetical/download/rollup-plugin-hypothetical-1.0.0.tgz"},"maintainers":[{"name":"permutator","email":"permutatorem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-hypothetical-1.0.0.tgz_1463020792654_0.31619374779984355"},"directories":{},"publish_time":1463020795658,"_cnpm_publish_time":1463020795658,"_hasShrinkwrap":false}},"readme":"# rollup-plugin-hypothetical [![npm][npm-image]][npm-url] [![Build Status][ghactions-image]][ghactions-url]\nThis allows [Rollup] modules to import hypothetical files passed in as options to the plugin.\n\n## Installation\n```bash\nnpm install --save-dev rollup-plugin-hypothetical\n```\n\n## Usage\n```js\n// rollup.config.js\nimport hypothetical from 'rollup-plugin-hypothetical';\n\nexport default {\n  entry: './dir/a.js',\n  plugins: [hypothetical({\n    files: {\n      './dir/a.js': `\n        import foo from './b.js';\n        foo();\n      `,\n      './dir/b.js': `\n        import message from 'external';\n        export default function foo() {\n          console.log(message);\n        }\n      `,\n      'external/': `\n        export default \"Hello, World!\";\n      `\n    }\n  })]\n};\n```\n\n## Sourcemaps\nTo attach a sourcemap to a hypothetical file, simply pass in a `{ code, map }` object instead of a string. The sourcemap can have its own `sources`, `sourcesContent`, etc.\n\n## Options\n### options.files\nAn object whose keys are paths, either relative to the current working directory or absolute, and whose values are the code within the hypothetical files at those paths.\n\n### options.filesMap\nRather than supplying a plain object to `options.files`, you may choose to supply a `Map` to `options.filesMap`. This will allow you to do things like naming your hypothetical files `__proto__`.\n\n### options.allowFallthrough\nDefaults to `false`. Set this to `true` to allow non-external imports to fall through. That way they can be handled either by Rollup's default behavior (reading from the filesystem) or by a plugin further down the chain if there is one.\n\n### options.allowExternalFallthrough\nDefaults to `true`. Set this to `false` to forbid external imports from falling through.\n\n### options.allowRelativeExternalFallthrough\nDefaults to `false`. Set this to `true` to allow relative imports from supplied external modules to fall through. For instance, suppose you have the following `options.files`:\n\n```js\n{\n  './main.js': `\n    import 'external/x.js';\n  `,\n  'external/x.js': `\n    import './y.js';\n  `\n}\n```\n\nThe supplied file `external/x.js` imports `external/y.js`, but `external/y.js` isn't supplied. This sort of thing is probably a mistake. If it isn't, set `options.allowRelativeExternalFallthrough` to `true` and **remember** to [include `external: ['external/y.js']` in the options you pass to `rollup.rollup`](https://rollupjs.org/#external-e-external-). If you forget that part, your build won't work, and weird things may happen instead!\n\n### options.leaveIdsAlone\nWhen this is set to `true`, the IDs in `import` statements won't be treated as paths and will instead be looked up directly in the `files` object. There will be no relative importing, path normalization, or restrictions on the contents of IDs.\n\n### options.impliedExtensions\nSet this to an array of file extensions to try appending to imports if an exact match isn't found. Defaults to `['.js', '/']`. If this is set to `false` or an empty array, file extensions and trailing slashes in imports will be treated as mandatory.\n\n### options.cwd\nWhen this is set to a directory name, relative file paths will be resolved relative to that directory rather than `process.cwd()`. When it's set to `false`, they will be resolved relative to an imaginary directory that cannot be expressed as an absolute path.\n\n\n## License\nMIT\n\n\n[npm-url]:       https://npmjs.org/package/rollup-plugin-hypothetical\n[ghactions-url]: https://github.com/lemmabit/rollup-plugin-hypothetical/actions/workflows/node.js.yml\n\n[npm-image]:       https://img.shields.io/npm/v/rollup-plugin-hypothetical.svg\n[ghactions-image]: https://github.com/lemmabit/rollup-plugin-hypothetical/actions/workflows/node.js.yml/badge.svg\n\n[Rollup]: https://www.npmjs.com/package/rollup\n","_attachments":{},"homepage":"https://github.com/Permutatrix/rollup-plugin-hypothetical#readme","bugs":{"url":"https://github.com/Permutatrix/rollup-plugin-hypothetical/issues"},"license":"MIT"}