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

System output dependency missing #4128

Closed
guybedford opened this issue Aug 3, 2015 · 2 comments
Closed

System output dependency missing #4128

guybedford opened this issue Aug 3, 2015 · 2 comments

Comments

@guybedford
Copy link
Contributor

I'm making some progress getting the TypeScript tests running for SystemJS builder. Currently this issue and systemjs/builder#262 are the blocking issues as far as I can tell.

For the following input source running against the currently nightly:

import 'jquery-cdn';
import '@empty';
import { dep } from "./second.js";
import './amd.js';
import './component.jsx!./jsx.js';

The output from TypeScript is:

System.register(['jquery-cdn', '@empty', './amd.js', './component.jsx!./jsx.js'], function(exports_1) {
    var __extends = (this && this.__extends) || function (d, b) {
        for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
    var p, test;
    return {
        setters:[
            function (_) {},
            function (_) {},
            function (_) {},
            function (_) {}],
        execute: function() {
            exports_1("p", p = 5);
            test = (function (_super) {
                __extends(test, _super);
                function test() {
                    _super.call(this);
                }
                return test;
            })(Object);
            exports_1("test", test);
        }
    }
});

Note how the ./second.js dependency is missing in the above.

Just let me know if there is anything further I can do to help, really appreciate the work to get these workflows running.

@vladima
Copy link
Contributor

vladima commented Aug 3, 2015

When processing the whole program TypeScript compiler will elide imports that are not used in as values. There is a compiler option isolatedModules to relax this behavior and suppress elision, it is used when files are compiled separately.Currently it used automatically when user calls transpile/transpilerModule functions and also it can be set via compiler API.

@guybedford
Copy link
Contributor Author

Ah I see, ok sure so by just making sure dep is used I was able to fix this! Awesome, thanks.

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants