-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Compile bundled files and typing files #671
Compile bundled files and typing files #671
Conversation
Awesome - thanks for this! I'll try and take a look later on. BTW we only need comparison test output for the latest released version of TypeScript (2.5 right now). I really should make that clearer in the docs! |
src/index.ts
Outdated
@@ -110,7 +110,7 @@ function getLoaderOptions(loader: Webpack) { | |||
} | |||
|
|||
type ValidLoaderOptions = keyof LoaderOptions; | |||
const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs' /* DEPRECATED */, 'happyPackMode', 'getCustomTransformers']; | |||
const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs', 'onlyCompileBundledFiles' /* DEPRECATED */, 'happyPackMode', 'getCustomTransformers']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you move /* DEPRECATED */
back to after 'entryFileCannotBeJs
?
Generally this looks good - could you remove comparison test output apart from 2.5? Also could you add something to the |
Remove unnecessary expected output for tests Add documentation on the option to the README Fix location of a comment in src/index.ts
@johnnyreilly Thanks for the quick review. I made some updates to address your comments. |
Sweet - I'll try and take a look tomorrow. Thanks! |
Perfect! |
Hope to ship this with ts-loader 3.1.0 |
This PR adds a flag that modifies the behavior of
ts-loader
so that it only loads files that are bundled by webpack and any.d.ts
files that match the config intsconfig.json
. This is an attempt to implement the behavior described in #267, or at least a starting point.The approach is very simple and I can't help but feel like there's some obvious issue with it that I'm not thinking of, but it seems to work fine in the test case I created at least. The reason for compiling all
.d.ts
files as well as bundled files is that they may include types that are used in files that are bundled without being explicitly imported. Attempting to determine exactly which files are needed seems like it may be quite difficult and potentially slow.