Skip to content

Commit

Permalink
Merge pull request #1487 from TheWeatherCompany/twc-master
Browse files Browse the repository at this point in the history
Error occurs when using webpack loader query string as import in rollup
  • Loading branch information
Rich-Harris committed Jul 13, 2017
2 parents 2ff79f9 + b00bc3c commit e1e0f5a
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/finalisers/shared/getInteropBlock.js
Expand Up @@ -11,7 +11,7 @@ export default function getInteropBlock ( bundle, options ) {
return `${bundle.varOrConst} ${module.name}__default = 'default' in ${module.name} ? ${module.name}['default'] : ${module.name};`;
}

return `${module.name} = ${module.name} && 'default' in ${module.name} ? ${module.name}['default'] : ${module.name};`;
return `${module.name} = ${module.name} && ${module.name}.hasOwnProperty('default') ? ${module.name}['default'] : ${module.name};`;
})
.filter( Boolean )
.join( '\n' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/export-default-import/_expected/amd.js
@@ -1,6 +1,6 @@
define(['exports', 'x'], function (exports, x) { 'use strict';

x = x && 'default' in x ? x['default'] : x;
x = x && x.hasOwnProperty('default') ? x['default'] : x;



Expand Down
2 changes: 1 addition & 1 deletion test/form/export-default-import/_expected/iife.js
@@ -1,7 +1,7 @@
var myBundle = (function (exports,x) {
'use strict';

x = x && 'default' in x ? x['default'] : x;
x = x && x.hasOwnProperty('default') ? x['default'] : x;



Expand Down
2 changes: 1 addition & 1 deletion test/form/export-default-import/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory((global.myBundle = {}),global.x));
}(this, (function (exports,x) { 'use strict';

x = x && 'default' in x ? x['default'] : x;
x = x && x.hasOwnProperty('default') ? x['default'] : x;



Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports-custom-names/_expected/amd.js
@@ -1,6 +1,6 @@
define(['jquery'], function ($) { 'use strict';

$ = $ && 'default' in $ ? $['default'] : $;
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;

$( function () {
$( 'body' ).html( '<h1>hello world!</h1>' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports-custom-names/_expected/iife.js
@@ -1,7 +1,7 @@
(function ($) {
'use strict';

$ = $ && 'default' in $ ? $['default'] : $;
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;

$( function () {
$( 'body' ).html( '<h1>hello world!</h1>' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports-custom-names/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.jQuery));
}(this, (function ($) { 'use strict';

$ = $ && 'default' in $ ? $['default'] : $;
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;

$( function () {
$( 'body' ).html( '<h1>hello world!</h1>' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports/_expected/amd.js
@@ -1,6 +1,6 @@
define(['factory', 'baz', 'shipping-port', 'alphabet'], function (factory, baz, containers, alphabet) { 'use strict';

factory = factory && 'default' in factory ? factory['default'] : factory;
factory = factory && factory.hasOwnProperty('default') ? factory['default'] : factory;
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet;

factory( null );
Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports/_expected/iife.js
@@ -1,7 +1,7 @@
(function (factory,baz,containers,alphabet) {
'use strict';

factory = factory && 'default' in factory ? factory['default'] : factory;
factory = factory && factory.hasOwnProperty('default') ? factory['default'] : factory;
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet;

factory( null );
Expand Down
2 changes: 1 addition & 1 deletion test/form/external-imports/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.factory,global.baz,global.containers,global.alphabet));
}(this, (function (factory,baz,containers,alphabet) { 'use strict';

factory = factory && 'default' in factory ? factory['default'] : factory;
factory = factory && factory.hasOwnProperty('default') ? factory['default'] : factory;
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet;

factory( null );
Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-function/_expected/amd.js
@@ -1,6 +1,6 @@
define(['https://unpkg.com/foo'], function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-function/_expected/iife.js
@@ -1,7 +1,7 @@
(function (foo) {
'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-function/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.foo));
}(this, (function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-relative/_expected/amd.js
@@ -1,6 +1,6 @@
define(['../foo'], function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-relative/_expected/iife.js
@@ -1,7 +1,7 @@
(function (foo) {
'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths-relative/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.foo));
}(this, (function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths/_expected/amd.js
@@ -1,6 +1,6 @@
define(['https://unpkg.com/foo'], function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths/_expected/iife.js
@@ -1,7 +1,7 @@
(function (foo) {
'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/paths/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.foo));
}(this, (function (foo) { 'use strict';

foo = foo && 'default' in foo ? foo['default'] : foo;
foo = foo && foo.hasOwnProperty('default') ? foo['default'] : foo;

assert.equal( foo, 42 );

Expand Down
2 changes: 1 addition & 1 deletion test/form/relative-external-with-global/_expected/amd.js
@@ -1,6 +1,6 @@
define(['./lib/throttle.js'], function (throttle) { 'use strict';

throttle = throttle && 'default' in throttle ? throttle['default'] : throttle;
throttle = throttle && throttle.hasOwnProperty('default') ? throttle['default'] : throttle;

const fn = throttle( () => {
console.log( '.' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/relative-external-with-global/_expected/iife.js
@@ -1,7 +1,7 @@
(function (throttle) {
'use strict';

throttle = throttle && 'default' in throttle ? throttle['default'] : throttle;
throttle = throttle && throttle.hasOwnProperty('default') ? throttle['default'] : throttle;

const fn = throttle( () => {
console.log( '.' );
Expand Down
2 changes: 1 addition & 1 deletion test/form/relative-external-with-global/_expected/umd.js
Expand Up @@ -4,7 +4,7 @@
(factory(global.Lib.throttle));
}(this, (function (throttle) { 'use strict';

throttle = throttle && 'default' in throttle ? throttle['default'] : throttle;
throttle = throttle && throttle.hasOwnProperty('default') ? throttle['default'] : throttle;

const fn = throttle( () => {
console.log( '.' );
Expand Down

0 comments on commit e1e0f5a

Please sign in to comment.