Codebase list node-rollup-plugin-commonjs / a46724f
New upstream version 9.1.8 Julien Puydt 5 years ago
7 changed file(s) with 37 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
00 # rollup-plugin-commonjs changelog
1
2 ## 9.1.8
3 *2018-09-18*
4 * Ignore virtual modules created by other plugins ([#327](https://github.com/rollup/rollup-plugin-commonjs/issues/327))
5 * Add "location" and "process" to reserved words ([#330](https://github.com/rollup/rollup-plugin-commonjs/issues/330))
6
7 ## 9.1.6
8 *2018-08-24*
9 * Keep commonJS detection between instantiations ([#338](https://github.com/rollup/rollup-plugin-commonjs/issues/338))
110
211 ## 9.1.5
312 *2018-08-09*
00 {
11 "name": "rollup-plugin-commonjs",
2 "version": "9.1.5",
2 "version": "9.1.8",
33 "lockfileVersion": 1,
44 "requires": true,
55 "dependencies": {
00 {
11 "name": "rollup-plugin-commonjs",
2 "version": "9.1.6",
2 "version": "9.1.8",
33 "description": "Convert CommonJS modules to ES2015",
44 "main": "dist/rollup-plugin-commonjs.cjs.js",
55 "module": "dist/rollup-plugin-commonjs.es.js",
7070 let entryModuleIdsPromise = null;
7171
7272 function resolveId ( importee, importer ) {
73 if ( importee === HELPERS_ID ) return importee;
74
75 if ( importer && startsWith( importer, PREFIX ) ) importer = importer.slice( PREFIX.length );
76
7773 const isProxyModule = startsWith( importee, PREFIX );
78 if ( isProxyModule ) importee = importee.slice( PREFIX.length );
74 if ( isProxyModule ) {
75 importee = importee.slice( PREFIX.length );
76 }
77 else if ( startsWith( importee, '\0' ) ) {
78 return importee;
79 }
80
81 if ( importer && startsWith( importer, PREFIX ) ) {
82 importer = importer.slice( PREFIX.length );
83 }
7984
8085 return resolveUsingOtherResolvers( importee, importer ).then( resolved => {
8186 if ( resolved ) return isProxyModule ? PREFIX + resolved : resolved;
44 import { PREFIX, HELPERS_ID } from './helpers.js';
55 import { getName } from './utils.js';
66
7 const reserved = 'abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split( ' ' );
7 const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split( ' ' );
88 const blacklist = { __esModule: true };
99 reserved.forEach( word => blacklist[ word ] = true );
1010
0 module.exports = require('\0virtual');
575575 assert.equal( error.frame, '1: export const foo = 2,\n ^' );
576576 }
577577 });
578
579 it('ignores virtual modules', async () => {
580 const bundle = await rollup({
581 input: 'samples/ignore-virtual-modules/main.js',
582 plugins: [ commonjs(), {
583 load (id) {
584 if (id === '\0virtual') {
585 return 'export default "Virtual export"';
586 }
587 }
588 } ]
589 });
590 assert.equal( (await executeBundle( bundle )).exports, 'Virtual export' );
591 });
578592 });
579593 });