Browse Source

Merge pull request #383 from rollup/gh-378

support namespaced exports (global.foo.bar.baz)
gh-384
Rich Harris 9 years ago
parent
commit
74389cde93
  1. 2
      package.json
  2. 24
      src/finalisers/iife.js
  3. 15
      src/finalisers/umd.js
  4. 6
      test/form/namespaced-default-exports/_config.js
  5. 7
      test/form/namespaced-default-exports/_expected/amd.js
  6. 5
      test/form/namespaced-default-exports/_expected/cjs.js
  7. 3
      test/form/namespaced-default-exports/_expected/es6.js
  8. 9
      test/form/namespaced-default-exports/_expected/iife.js
  9. 11
      test/form/namespaced-default-exports/_expected/umd.js
  10. 1
      test/form/namespaced-default-exports/main.js
  11. 6
      test/form/namespaced-named-exports/_config.js
  12. 7
      test/form/namespaced-named-exports/_expected/amd.js
  13. 5
      test/form/namespaced-named-exports/_expected/cjs.js
  14. 3
      test/form/namespaced-named-exports/_expected/es6.js
  15. 9
      test/form/namespaced-named-exports/_expected/iife.js
  16. 11
      test/form/namespaced-named-exports/_expected/umd.js
  17. 1
      test/form/namespaced-named-exports/main.js
  18. 2
      test/form/sourcemaps-inline/_expected/amd.js
  19. 2
      test/form/sourcemaps-inline/_expected/cjs.js
  20. 2
      test/form/sourcemaps-inline/_expected/es6.js
  21. 2
      test/form/sourcemaps-inline/_expected/iife.js
  22. 2
      test/form/sourcemaps-inline/_expected/umd.js
  23. 2
      test/form/sourcemaps/_expected/amd.js.map
  24. 2
      test/form/sourcemaps/_expected/cjs.js.map
  25. 2
      test/form/sourcemaps/_expected/es6.js.map
  26. 2
      test/form/sourcemaps/_expected/iife.js.map
  27. 2
      test/form/sourcemaps/_expected/umd.js.map

2
package.json

@ -48,7 +48,7 @@
"eslint": "^1.7.1",
"estree-walker": "^0.2.0",
"istanbul": "^0.4.0",
"magic-string": "^0.8.0",
"magic-string": "^0.10.0",
"mocha": "^2.3.3",
"remap-istanbul": "^0.4.0",
"rollup": "^0.20.2",

24
src/finalisers/iife.js

@ -3,8 +3,22 @@ import { getName } from '../utils/map-helpers.js';
import getInteropBlock from './shared/getInteropBlock.js';
import getExportBlock from './shared/getExportBlock.js';
function setupNamespace ( keypath ) {
let parts = keypath.split( '.' ); // TODO support e.g. `foo['something-hyphenated']`?
parts.pop();
let acc = 'this';
return parts
.map( part => ( acc += `.${part}`, `${acc} = ${acc} || {};` ) )
.join( '\n' ) + '\n';
}
export default function iife ( bundle, magicString, { exportMode, indentString }, options ) {
const globalNames = options.globals || blank();
const name = options.moduleName;
const isNamespaced = name && ~name.indexOf( '.' );
let dependencies = bundle.externalModules.map( module => {
return globalNames[ module.id ] || module.name;
@ -12,12 +26,12 @@ export default function iife ( bundle, magicString, { exportMode, indentString }
let args = bundle.externalModules.map( getName );
if ( exportMode !== 'none' && !options.moduleName ) {
if ( exportMode !== 'none' && !name ) {
throw new Error( 'You must supply options.moduleName for IIFE bundles' );
}
if ( exportMode === 'named' ) {
dependencies.unshift( `(this.${options.moduleName} = {})` );
dependencies.unshift( `(this.${name} = {})` );
args.unshift( 'exports' );
}
@ -26,7 +40,11 @@ export default function iife ( bundle, magicString, { exportMode, indentString }
let outro = `\n\n})(${dependencies});`;
if ( exportMode === 'default' ) {
intro = `var ${options.moduleName} = ${intro}`;
intro = ( isNamespaced ? `this.` : `var ` ) + `${name} = ${intro}`;
}
if ( isNamespaced ) {
intro = setupNamespace( name ) + intro;
}
// var foo__default = 'default' in foo ? foo['default'] : foo;

15
src/finalisers/umd.js

@ -3,6 +3,17 @@ import { getName, quoteId, req } from '../utils/map-helpers.js';
import getInteropBlock from './shared/getInteropBlock.js';
import getExportBlock from './shared/getExportBlock.js';
function setupNamespace ( name ) {
const parts = name.split( '.' );
parts.pop();
let acc = 'global';
return parts
.map( part => ( acc += `.${part}`, `${acc} = ${acc} || {}` ) )
.concat( `global.${name}` )
.join( ', ' );
}
export default function umd ( bundle, magicString, { exportMode, indentString }, options ) {
if ( exportMode !== 'none' && !options.moduleName ) {
throw new Error( 'You must supply options.moduleName for UMD bundles' );
@ -21,7 +32,7 @@ export default function umd ( bundle, magicString, { exportMode, indentString },
if ( exportMode === 'named' ) {
amdDeps.unshift( `'exports'` );
cjsDeps.unshift( `exports` );
globalDeps.unshift( `(global.${options.moduleName} = {})` );
globalDeps.unshift( `(${setupNamespace(options.moduleName)} = {})` );
args.unshift( 'exports' );
}
@ -31,7 +42,7 @@ export default function umd ( bundle, magicString, { exportMode, indentString },
( amdDeps.length ? `[${amdDeps.join( ', ' )}], ` : `` );
const cjsExport = exportMode === 'default' ? `module.exports = ` : ``;
const defaultExport = exportMode === 'default' ? `global.${options.moduleName} = ` : '';
const defaultExport = exportMode === 'default' ? `${setupNamespace(options.moduleName)} = ` : '';
const useStrict = options.useStrict !== false ? ` 'use strict';` : ``;

6
test/form/namespaced-default-exports/_config.js

@ -0,0 +1,6 @@
module.exports = {
description: 'creates namespaced module names',
options: {
moduleName: 'foo.bar.baz'
}
};

7
test/form/namespaced-default-exports/_expected/amd.js

@ -0,0 +1,7 @@
define(function () { 'use strict';
var main = 42;
return main;
});

5
test/form/namespaced-default-exports/_expected/cjs.js

@ -0,0 +1,5 @@
'use strict';
var main = 42;
module.exports = main;

3
test/form/namespaced-default-exports/_expected/es6.js

@ -0,0 +1,3 @@
var main = 42;
export default main;

9
test/form/namespaced-default-exports/_expected/iife.js

@ -0,0 +1,9 @@
this.foo = this.foo || {};
this.foo.bar = this.foo.bar || {};
this.foo.bar.baz = (function () { 'use strict';
var main = 42;
return main;
})();

11
test/form/namespaced-default-exports/_expected/umd.js

@ -0,0 +1,11 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = factory();
}(this, function () { 'use strict';
var main = 42;
return main;
}));

1
test/form/namespaced-default-exports/main.js

@ -0,0 +1 @@
export default 42;

6
test/form/namespaced-named-exports/_config.js

@ -0,0 +1,6 @@
module.exports = {
description: 'creates namespaced module names',
options: {
moduleName: 'foo.bar.baz'
}
};

7
test/form/namespaced-named-exports/_expected/amd.js

@ -0,0 +1,7 @@
define(['exports'], function (exports) { 'use strict';
var answer = 42;
exports.answer = answer;
});

5
test/form/namespaced-named-exports/_expected/cjs.js

@ -0,0 +1,5 @@
'use strict';
var answer = 42;
exports.answer = answer;

3
test/form/namespaced-named-exports/_expected/es6.js

@ -0,0 +1,3 @@
var answer = 42;
export { answer };

9
test/form/namespaced-named-exports/_expected/iife.js

@ -0,0 +1,9 @@
this.foo = this.foo || {};
this.foo.bar = this.foo.bar || {};
(function (exports) { 'use strict';
var answer = 42;
exports.answer = answer;
})((this.foo.bar.baz = {}));

11
test/form/namespaced-named-exports/_expected/umd.js

@ -0,0 +1,11 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.foo = global.foo || {}, global.foo.bar = global.foo.bar || {}, global.foo.bar.baz = {}));
}(this, function (exports) { 'use strict';
var answer = 42;
exports.answer = answer;
}));

1
test/form/namespaced-named-exports/main.js

@ -0,0 +1 @@
export var answer = 42;

2
test/form/sourcemaps-inline/_expected/amd.js

@ -14,4 +14,4 @@ define(function () { 'use strict';
bar();
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1kLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb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GYyxTQUFTLEdBQUcsSUFBSTtBQUMvQixDQUFBLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0FBQ3BDLENBQUEsQ0FBQzs7Q0NDRCxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7O0FBRXBDLENBQUEsR0FBRyxFQUFFLENBQUM7QUFDTixDQUFBLEdBQUcsRUFBRSxDQUFDLDs7In0=

2
test/form/sourcemaps-inline/_expected/cjs.js

@ -12,4 +12,4 @@ console.log( 'hello from main.js' );
foo();
bar();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2pzLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBZSxTQUFTLEdBQUcsSUFBSTtDQUM5QixPQUFPLENBQUMsR0FBRyxFQUFFLG1CQUFtQixFQUFFOzs7QUNEcEIsU0FBUyxHQUFHLElBQUk7Q0FDOUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRTs7O0FDRW5DLE9BQU8sQ0FBQyxHQUFHLEVBQUUsb0JBQW9CLEVBQUU7O0FBRW5DLEdBQUcsRUFBRTtBQUNMLEdBQUcsRUFBRSJ9
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2pzLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBZSxTQUFTLEdBQUcsSUFBSTtDQUM5QixPQUFPLENBQUMsR0FBRyxFQUFFLG1CQUFtQixFQUFFLENBQUM7Q0FDbkM7O0FDRmMsU0FBUyxHQUFHLElBQUk7Q0FDOUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0NBQ25DOztBQ0NELE9BQU8sQ0FBQyxHQUFHLEVBQUUsb0JBQW9CLEVBQUUsQ0FBQzs7QUFFcEMsR0FBRyxFQUFFLENBQUM7QUFDTixHQUFHLEVBQUUsQ0FBQyJ9

2
test/form/sourcemaps-inline/_expected/es6.js

@ -10,4 +10,4 @@ console.log( 'hello from main.js' );
foo();
bar();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXM2LmpzIiwic291cmNlcyI6WyIuL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JyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWUsU0FBUyxHQUFHLElBQUk7Q0FDOUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRSxDQUFDO0NBQ25DOztBQ0ZjLFNBQVMsR0FBRyxJQUFJO0NBQzlCLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztDQUNuQzs7QUNDRCxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLENBQUM7O0FBRXBDLEdBQUcsRUFBRSxDQUFDO0FBQ04sR0FBRyxFQUFFLENBQUMifQ==

2
test/form/sourcemaps-inline/_expected/iife.js

@ -14,4 +14,4 @@
bar();
})();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWlmZS5qcyIsInNvdXJjZXMiOlsiLi4vZm9vLmpzIiwiLi4vYmFyLmpzIiwiLi4vbWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmb28gKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gZm9vLmpzJyApO1xufVxuIiwiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gYmFyICgpIHtcblx0Y29uc29sZS5sb2coICdoZWxsbyBmcm9tIGJhci5qcycgKTtcbn1cbiIsImltcG9ydCBmb28gZnJvbSAnLi9mb28nO1xuaW1wb3J0IGJhciBmcm9tICcuL2Jhcic7XG5cbmNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBtYWluLmpzJyApO1xuXG5mb28oKTtcbmJhcigpO1xuIl0sI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BQUUsQ0FBQztBQUNwQyxDQUFBLENBQUM7O0NDQ0QsT0FBTyxDQUFDLEdBQUcsRUFBRSxvQkFBb0IsRUFBRSxDQUFDOztBQUVwQyxDQUFBLEdBQUcsRUFBRSxDQUFDO0FBQ04sQ0FBQSxHQUFHLEVBQUUsQ0FBQyw7OyJ9

2
test/form/sourcemaps-inline/_expected/umd.js

@ -18,4 +18,4 @@
bar();
}));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW1kLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0NBQWUsU0FBUyxHQUFHLElBQUk7RUFDOUIsT0FBTyxDQUFDLEdBQUcsRUFBRSxtQkFBbUIsRUFBRTs7O0NDRHBCLFNBQVMsR0FBRyxJQUFJO0VBQzlCLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUU7OztDQ0VuQyxPQUFPLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFOztDQUVuQyxHQUFHLEVBQUU7Q0FDTCxHQUFHLEVBQUUsOzsifQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW1kLmpzIiwic291cmNlcyI6WyIuLi9mb28uanMiLCIuLi9iYXIuanMiLCIuLi9tYWluLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZvbyAoKSB7XG5cdGNvbnNvbGUubG9nKCAnaGVsbG8gZnJvbSBmb28uanMnICk7XG59XG4iLCJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBiYXIgKCkge1xuXHRjb25zb2xlLmxvZyggJ2hlbGxvIGZyb20gYmFyLmpzJyApO1xufVxuIiwiaW1wb3J0IGZvbyBmcm9tICcuL2Zvbyc7XG5pbXBvcnQgYmFyIGZyb20gJy4vYmFyJztcblxuY29uc29sZS5sb2coICdoZWxsbyBmcm9tIG1haW4uanMnICk7XG5cbmZvbygpO1xuYmFyKCk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0NBQWUsU0FBUyxHQUFHLElBQUk7QUFDL0IsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQyxDQUFBLENBQUM7O0NDRmMsU0FBUyxHQUFHLElBQUk7QUFDL0IsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsbUJBQW1CLEVBQUUsQ0FBQztBQUNwQyxDQUFBLENBQUM7O0NDQ0QsT0FBTyxDQUFDLEdBQUcsRUFBRSxvQkFBb0IsRUFBRSxDQUFDOztBQUVwQyxDQUFBLEdBQUcsRUFBRSxDQUFDO0FBQ04sQ0FBQSxHQUFHLEVBQUUsQ0FBQyw7OyJ9

2
test/form/sourcemaps/_expected/amd.js.map

@ -1 +1 @@
{"version":3,"file":"amd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCDpB,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCEnC,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE;;CAEnC,GAAG,EAAE;CACL,GAAG,EAAE,;;"}
{"version":3,"file":"amd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCFc,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,CAAA,GAAG,EAAE,CAAC;AACN,CAAA,GAAG,EAAE,CAAC,;;"}

2
test/form/sourcemaps/_expected/cjs.js.map

@ -1 +1 @@
{"version":3,"file":"cjs.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;AAAe,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;ACDpB,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;ACEnC,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE;;AAEnC,GAAG,EAAE;AACL,GAAG,EAAE"}
{"version":3,"file":"cjs.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;AAAe,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACnC;;ACFc,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACnC;;ACCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,GAAG,EAAE,CAAC;AACN,GAAG,EAAE,CAAC"}

2
test/form/sourcemaps/_expected/es6.js.map

@ -1 +1 @@
{"version":3,"file":"es6.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":"AAAe,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;ACDpB,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;ACEnC,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE;;AAEnC,GAAG,EAAE;AACL,GAAG,EAAE"}
{"version":3,"file":"es6.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":"AAAe,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACnC;;ACFc,SAAS,GAAG,IAAI;CAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;CACnC;;ACCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,GAAG,EAAE,CAAC;AACN,GAAG,EAAE,CAAC"}

2
test/form/sourcemaps/_expected/iife.js.map

@ -1 +1 @@
{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCDpB,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCEnC,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE;;CAEnC,GAAG,EAAE;CACL,GAAG,EAAE,;;"}
{"version":3,"file":"iife.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;CAAe,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCFc,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,CAAA,GAAG,EAAE,CAAC;AACN,CAAA,GAAG,EAAE,CAAC,;;"}

2
test/form/sourcemaps/_expected/umd.js.map

@ -1 +1 @@
{"version":3,"file":"umd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;;CAAe,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCDpB,SAAS,GAAG,IAAI;EAC9B,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE;;;CCEnC,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE;;CAEnC,GAAG,EAAE;CACL,GAAG,EAAE,;;"}
{"version":3,"file":"umd.js","sources":["../foo.js","../bar.js","../main.js"],"sourcesContent":["export default function foo () {\n\tconsole.log( 'hello from foo.js' );\n}\n","export default function bar () {\n\tconsole.log( 'hello from bar.js' );\n}\n","import foo from './foo';\nimport bar from './bar';\n\nconsole.log( 'hello from main.js' );\n\nfoo();\nbar();\n"],"names":[],"mappings":";;;;;;CAAe,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCFc,SAAS,GAAG,IAAI;AAC/B,CAAA,CAAC,OAAO,CAAC,GAAG,EAAE,mBAAmB,EAAE,CAAC;AACpC,CAAA,CAAC;;CCCD,OAAO,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;;AAEpC,CAAA,GAAG,EAAE,CAAC;AACN,CAAA,GAAG,EAAE,CAAC,;;"}
Loading…
Cancel
Save