Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Loader will add all files and subfiles as dependencies altough they are not referenced #330

Closed
@Llorx

Description

@Llorx

Simply, I have a big project with this file on it:

function c() {
    var compiler = webpack({
        context: __dirname,
        entry: "./main3.ts",
        output: {
            filename: 'bundle2.js',
            path: '/'
        },
        resolve: {
            extensions: [".ts", ".tsx", ".js"]
        },
        module: {
            loaders: [
                {
                    test: /\.tsx?$/,
                    loader: "awesome-typescript-loader"
                }
            ]
        }
    });
    compiler.plugin("compile", function () {
        console.log("cmp", i++);
    });
    return compiler.watch({
        aggregateTimeout: 333
    }, (err, stats) => {
        console.log(err, stats);
    });
}
var oldc = c();

Having main3.ts with a single console.log("asd"); line and the tsconfig.json file being this:

{
    "compilerOptions": {
        "jsx": "react",
        "module": "commonjs",
        "sourceMap": true,
        "target": "es5"
    }
}

When the compile ends, the fileDependencies array shows all the files of my project, and when I modify one of them, the watcher fires, so is actually looking for modifications on those files.

ts-loader is fine with this. How can I overcome this problem with awesome-typescript-loader?

EDIT: The furthest I've reached is this line which creates the damned filelist that later this line adds to the dependencies list, but now I'm pretty lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions