Comparing version 0.7.5 to 0.7.6
@@ -13,2 +13,3 @@ rollup version <%= version %> | ||
-f, --format [umd] Type of output (amd, cjs, es6, iife, umd) | ||
-e, --external Comma-separate list of module IDs to exclude | ||
-n, --name Name for UMD export | ||
@@ -15,0 +16,0 @@ -u, --id ID for AMD module (default is anonymous) |
@@ -15,3 +15,4 @@ #!/usr/bin/env node | ||
n: 'name', | ||
u: 'id' | ||
u: 'id', | ||
e: 'external' | ||
} | ||
@@ -18,0 +19,0 @@ }); |
@@ -37,3 +37,4 @@ require( 'source-map-support' ).install(); | ||
return rollup.rollup({ | ||
entry: options.input | ||
entry: options.input, | ||
external: options.external && options.external.split( ',' ) | ||
}).then( function ( bundle ) { | ||
@@ -40,0 +41,0 @@ var generateOptions = { |
# rollup changelog | ||
## 0.7.6 | ||
* Better placement of `export default` statements ([#21](https://github.com/rollup/rollup/issues/21)) | ||
* Prevent function calls and property assignments from being treated as rebinding for sake of unbound default exports | ||
* Add `--external foo,bar,baz` option to CLI (equivalent to `external: ['foo', 'bar', 'baz']`) | ||
* Add CLI tests | ||
## 0.7.5 | ||
@@ -4,0 +11,0 @@ |
@@ -365,3 +365,3 @@ 'use strict'; | ||
var addNode = function (node, disallowImportReassignments) { | ||
var addNode = function (node, isAssignment) { | ||
var depth = 0; // determine whether we're illegally modifying a binding or namespace | ||
@@ -375,3 +375,3 @@ | ||
// disallow assignments/updates to imported bindings and namespaces | ||
if (disallowImportReassignments) { | ||
if (isAssignment) { | ||
var importSpecifier = _this2.module.imports[node.name]; | ||
@@ -390,2 +390,13 @@ | ||
} | ||
// special case = `export default foo; foo += 1;` - we'll | ||
// need to assign a new variable so that the exported | ||
// value is not updated by the second statement | ||
if (_this2.module.exports.default && depth === 0 && _this2.module.exports.default.identifier === node.name) { | ||
// but only if this is a) inside a function body or | ||
// b) after the export declaration | ||
if (!!scope.parent || node.start > _this2.module.exports.default.statement.node.start) { | ||
_this2.module.exports.default.isModified = true; | ||
} | ||
} | ||
} | ||
@@ -396,13 +407,2 @@ | ||
} | ||
// special case = `export default foo; foo += 1;` - we'll | ||
// need to assign a new variable so that the exported | ||
// value is not updated by the second statement | ||
if (_this2.module.exports.default && _this2.module.exports.default.identifier === node.name) { | ||
// but only if this is a) inside a function body or | ||
// b) after the export declaration | ||
if (!!scope.parent || node.start > _this2.module.exports.default.statement.node.start) { | ||
_this2.module.exports.default.isModified = true; | ||
} | ||
} | ||
}; | ||
@@ -1033,9 +1033,8 @@ | ||
var len = statements.length; | ||
var i = undefined; | ||
var i = statements.length; | ||
var inserted = false; | ||
for (i = 0; i < len; i += 1) { | ||
if (statements[i].module === _this3 && statements[i].index > defaultExportStatement.index) { | ||
statements.splice(i, 0, defaultExportStatement); | ||
while (i--) { | ||
if (statements[i].module === _this3 && statements[i].index < defaultExportStatement.index) { | ||
statements.splice(i + 1, 0, defaultExportStatement); | ||
inserted = true; | ||
@@ -1042,0 +1041,0 @@ break; |
{ | ||
"name": "rollup", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Next-generation ES6 module bundler", | ||
@@ -5,0 +5,0 @@ "main": "dist/rollup.js", |
@@ -358,9 +358,8 @@ import { Promise } from 'sander'; | ||
const len = statements.length; | ||
let i; | ||
let i = statements.length; | ||
let inserted = false; | ||
for ( i = 0; i < len; i += 1 ) { | ||
if ( statements[i].module === this && statements[i].index > defaultExportStatement.index ) { | ||
statements.splice( i, 0, defaultExportStatement ); | ||
while ( i-- ) { | ||
if ( statements[i].module === this && statements[i].index < defaultExportStatement.index ) { | ||
statements.splice( i + 1, 0, defaultExportStatement ); | ||
inserted = true; | ||
@@ -367,0 +366,0 @@ break; |
@@ -149,3 +149,3 @@ import { blank, keys } from './utils/object'; | ||
checkForWrites ( scope, node ) { | ||
const addNode = ( node, disallowImportReassignments ) => { | ||
const addNode = ( node, isAssignment ) => { | ||
let depth = 0; // determine whether we're illegally modifying a binding or namespace | ||
@@ -159,3 +159,3 @@ | ||
// disallow assignments/updates to imported bindings and namespaces | ||
if ( disallowImportReassignments ) { | ||
if ( isAssignment ) { | ||
const importSpecifier = this.module.imports[ node.name ]; | ||
@@ -175,2 +175,13 @@ | ||
} | ||
// special case = `export default foo; foo += 1;` - we'll | ||
// need to assign a new variable so that the exported | ||
// value is not updated by the second statement | ||
if ( this.module.exports.default && depth === 0 && this.module.exports.default.identifier === node.name ) { | ||
// but only if this is a) inside a function body or | ||
// b) after the export declaration | ||
if ( !!scope.parent || node.start > this.module.exports.default.statement.node.start ) { | ||
this.module.exports.default.isModified = true; | ||
} | ||
} | ||
} | ||
@@ -181,13 +192,2 @@ | ||
} | ||
// special case = `export default foo; foo += 1;` - we'll | ||
// need to assign a new variable so that the exported | ||
// value is not updated by the second statement | ||
if ( this.module.exports.default && this.module.exports.default.identifier === node.name ) { | ||
// but only if this is a) inside a function body or | ||
// b) after the export declaration | ||
if ( !!scope.parent || node.start > this.module.exports.default.statement.node.start ) { | ||
this.module.exports.default.isModified = true; | ||
} | ||
} | ||
}; | ||
@@ -194,0 +194,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218028