Skip to content
This repository has been 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 opened this issue Dec 20, 2016 · 1 comment

Comments

@Llorx
Copy link

Llorx commented Dec 20, 2016

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.

@s-panferov
Copy link
Owner

Closed in favour of #364

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