New upstream version 9.1.8
Julien Puydt
5 years ago
0 | 0 |
# 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))
|
1 | 10 |
|
2 | 11 |
## 9.1.5
|
3 | 12 |
*2018-08-09*
|
0 | 0 |
{
|
1 | 1 |
"name": "rollup-plugin-commonjs",
|
2 | |
"version": "9.1.5",
|
|
2 |
"version": "9.1.8",
|
3 | 3 |
"lockfileVersion": 1,
|
4 | 4 |
"requires": true,
|
5 | 5 |
"dependencies": {
|
0 | 0 |
{
|
1 | 1 |
"name": "rollup-plugin-commonjs",
|
2 | |
"version": "9.1.6",
|
|
2 |
"version": "9.1.8",
|
3 | 3 |
"description": "Convert CommonJS modules to ES2015",
|
4 | 4 |
"main": "dist/rollup-plugin-commonjs.cjs.js",
|
5 | 5 |
"module": "dist/rollup-plugin-commonjs.es.js",
|
70 | 70 |
let entryModuleIdsPromise = null;
|
71 | 71 |
|
72 | 72 |
function resolveId ( importee, importer ) {
|
73 | |
if ( importee === HELPERS_ID ) return importee;
|
74 | |
|
75 | |
if ( importer && startsWith( importer, PREFIX ) ) importer = importer.slice( PREFIX.length );
|
76 | |
|
77 | 73 |
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 |
}
|
79 | 84 |
|
80 | 85 |
return resolveUsingOtherResolvers( importee, importer ).then( resolved => {
|
81 | 86 |
if ( resolved ) return isProxyModule ? PREFIX + resolved : resolved;
|
4 | 4 |
import { PREFIX, HELPERS_ID } from './helpers.js';
|
5 | 5 |
import { getName } from './utils.js';
|
6 | 6 |
|
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( ' ' );
|
8 | 8 |
const blacklist = { __esModule: true };
|
9 | 9 |
reserved.forEach( word => blacklist[ word ] = true );
|
10 | 10 |
|
|
0 |
module.exports = require('\0virtual');
|
575 | 575 |
assert.equal( error.frame, '1: export const foo = 2,\n ^' );
|
576 | 576 |
}
|
577 | 577 |
});
|
|
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 |
});
|
578 | 592 |
});
|
579 | 593 |
});
|