Browse Source

Merge branch 'master' into esperanto-friendly

contingency-plan
Rich-Harris 10 years ago
parent
commit
8d7093e11e
  1. 14
      CHANGELOG.md
  2. 2
      package.json
  3. 2
      src/Bundle.js
  4. 2
      src/Statement.js
  5. 15
      test/function/named-external-method-in-prototype/_config.js
  6. 5
      test/function/named-external-method-in-prototype/bar.js
  7. 9
      test/function/named-external-method-in-prototype/foo.js
  8. 3
      test/function/named-external-method-in-prototype/main.js

14
CHANGELOG.md

@ -1,5 +1,19 @@
# rollup changelog
## 0.12.1
* Don't attempt to mark statements belonging to external modules ([#68](https://github.com/rollup/rollup/issues/68))
* Correctly deshadow variables that conflict with imports ([#68](https://github.com/rollup/rollup/issues/68))
## 0.12.0
* Internal re-architecting, resulting in more efficient bundling with reduced memory usage
* Shorthand properties are expanded if necessary ([#61](https://github.com/rollup/rollup/issues/61))
* Fixed various bugs with bundle external dependencies, particularly when generating ES6 bundles ([#59](https://github.com/rollup/rollup/issues/59))
* Add `--globals` option to CLI ([#60](https://github.com/rollup/rollup/pull/60))
* Allow imports of external modules for side-effects ([#55](https://github.com/rollup/rollup/pull/55))
* Prevent Rollup hanging on non-existent external module ([#54](https://github.com/rollup/rollup/pull/54))
## 0.11.4
* Side-effect preservation applies to internal default exports ([#43](https://github.com/rollup/rollup/issues/43))

2
package.json

@ -1,6 +1,6 @@
{
"name": "rollup",
"version": "0.11.4",
"version": "0.12.1",
"description": "Next-generation ES6 module bundler",
"main": "dist/rollup.js",
"jsnext:main": "src/rollup.js",

2
src/Bundle.js

@ -246,6 +246,8 @@ export default class Bundle {
const promise = Promise.resolve( importDeclaration.module || this.fetchModule( importDeclaration.source, module.id ) )
.then( module => {
if ( module.isExternal ) return null;
importDeclaration.module = module;
const exportDeclaration = module.exports[ importDeclaration.name ];
// TODO things like `export default a + b` don't apply here... right?

2
src/Statement.js

@ -317,7 +317,7 @@ export default class Statement {
});
deshadowList.forEach( name => {
if ( ~scope.declarations[ name ] ) { // TODO is this right? no indexOf?
if ( scope.declarations[ name ] ) {
newNames[ name ] = name + '$$'; // TODO better mechanism
hasReplacements = true;
}

15
test/function/named-external-method-in-prototype/_config.js

@ -0,0 +1,15 @@
module.exports = {
description: 'method of external named import used inside prototype method (#68)',
context: {
// override require here, making "foo" appear as a global module
require: function ( name ) {
if ( name === 'bar' ) {
return require( './bar' );
}
return require( name );
}
},
options: {
external: [ 'bar' ]
}
};

5
test/function/named-external-method-in-prototype/bar.js

@ -0,0 +1,5 @@
exports.bar = {
foobar: function () {
return 42;
}
};

9
test/function/named-external-method-in-prototype/foo.js

@ -0,0 +1,9 @@
import { bar } from 'bar';
export default function Foo() {
this.answer = bar.foobar();
}
Foo.prototype.bar = function () {
return bar.foobar();
};

3
test/function/named-external-method-in-prototype/main.js

@ -0,0 +1,3 @@
import Foo from './foo.js';
assert.equal( new Foo().bar(), 42 );
Loading…
Cancel
Save