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

If set rootDir in tsconfig.json which under project, the ts-loader can't handle the piping output of ts-import-plugin #5

Closed
zheeeng opened this issue Aug 8, 2017 · 3 comments

Comments

@zheeeng
Copy link
Contributor

zheeeng commented Aug 8, 2017

In tsconfig.json, I set the rootDir option:

"compilerOptions": {
    "rootDir": "src"
}

The compiler console throw error:

File 'index.tsx' is not under 'rootDir' '/Users/XXX/Workspace/project/src'. 'rootDir' is expected to contain all source files.

Any idea on it?

@Brooooooklyn
Copy link
Collaborator

the entry of the webpack.config.js in this project is test/fixture/index.tsx , you can not set the rootDir to src unless you change the entry to src/xxx.tsx

@zheeeng
Copy link
Contributor Author

zheeeng commented Aug 9, 2017

@Brooooooklyn not for the dev on ts-import-plugin.
I'm using it to dev a react project(generated through create-react-app project --scripts-version=react-scripts-ts). The webpack config is ejected and I'm trying to inject ts-import-plugin for manually tree-shaking packs. Without ts-import-plugin, ts-loader read the tsconfig.json(contains rootDir) under my project well, but after adding the import syntax transforming hook, compiler print out the error message.
I suppose the upstream piped out by ts-import-plugin and is cached in memory(or some virtual file zone) cause the ts compiler failed.

Another hanging related issue for reference: TypeStrong/ts-loader#244

@Brooooooklyn
Copy link
Collaborator

close via TypeStrong/ts-loader#598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants