`allowJs` and `outDir` `compilerOptions` -- need to set plugin `include`
See original GitHub issueI am using tsc
to transpile ES6 javascript to ES5, by using
compilerOptions: {
"allowJs": true,
"outDir": "./build",
// ...
},
In my rollup.config.js, I have input: 'build/index.js'
,
My build script is then tsc && rollup -c
. This seems to work fine.
I would like to be able to use rollup-plugin-typescript2, rather than calling tsc on the command line, but rollup-plugin-typescript2 seems to disallow the outDir option. The docs say this option is forced. “outDir: process.cwd()”. Would it be possible to support this workflow with rollup-plugin-typescript2?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
Read more >visual studio - Typescript error "Cannot write file ... because it ...
I use the ts-loader with Webpack and not the tsc compiler directly so I didn't have to specify the outDir because the webpack...
Read more >Gatsby Typescript Plugin
Gatsby Typescript Plugin An alternative to the official typescript plugin, with & automatic type generation for your graphql queries (using…
Read more >@kingdarboja/serverless-plugin-typescript - npm
Zero-config: Works out of the box without the need to install any other compiler or plugins; Supports ES2015 syntax + features ( export...
Read more >Angular compiler options
Not recommended, as unsupported versions of TypeScript might have ... Instructs the Angular template compiler to create legacy ids for messages that are ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To find node modules and make them visible to rollup you need
rollup-plugin-node-resolve
androllup-plugin-commonjs
plugins.For
outDir
you should be able to keep it at any value you want (if you want to be able to runtsc
independently from rollup) and plugin will override it whentsconfig.json
is used in rollup. Try that and let me know if there are related errors emitted by the plugin itself.Yeah, rollup-plugin-typescript2 doesn’t write out individual transpiled files (if you ignore cache), it just passes code back to rollup and that rolls them into the bundle.
If you change your rollup config to
input: './index.js'
, and pass{ include: ["*.js", "**/*.js"] }
as plugin options, then everything would probably work.