Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFFE module target #7671

Closed
TheToolbox opened this issue Mar 24, 2016 · 3 comments
Closed

IFFE module target #7671

TheToolbox opened this issue Mar 24, 2016 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@TheToolbox
Copy link

Would anyone be interested in a PR for bundling ES6 modules into single IFFE-scoped files? (a la rollup.js) This would allow bundling for those who don't wish to rely on AMD/System, and remove at least one build step in many scenarios.

(Apologies if duplicate. Search/FAQ didn't come up with anything. If additional details are desired, I can put those together as well)

Example below (modified from rollupjs's website):

//main.ts (source)
import * as x from './maths';
var z : number = 3;
console.log( x.cube( 5 ) + z ); 
//maths.ts (source)
//variable namespacing could be accomplished by appending, as seen here, or via internal IFFEs
var z : number = 0;

export function square ( x : number ): number {
    return x * x + z;
}

//unreferenced functions intelligently culled
export function cube ( x : number ): number {
    return x * x * x + z;
}
//main.js (outFile)
(function () {
    'use strict';

    //variable namespacing could be accomplished by appending, as seen here, or via internal IFFEs
    var z$1 = 0;

    //unreferenced functions intelligently culled
    function cube ( x ) {
        return x * x * x + z$1;
    }

    var z = 3;
    console.log( cube( 5 ) + z );

}());
@mhegazy
Copy link
Contributor

mhegazy commented Mar 24, 2016

looks like a duplicate of #4434

@TheToolbox
Copy link
Author

Thanks, closing.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Mar 24, 2016
@dpogue
Copy link

dpogue commented Mar 24, 2016

See also #6319 which would allow you to use rollup to generate your final bundle.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants