-
-
Notifications
You must be signed in to change notification settings - Fork 199
Add loader for Typescript #9
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
Comments
Hi, thanks for this project. I has put lot of knowledge in place thanks to it. I would like to provide some imput from my current experience. I am using master branch, it means i have in
This allow me to use the recently addition to public API of Adding my TypeScript loader is then easy:
My problem is with the This means I can sucessfully add
Not being able to do this cause me problems resolving local modules.
If I hardcode the extensions in the config generator, then everything goes nice and dandy. things I have tried:
What am I missing? Cheers. |
Hey @davidmpaz! Thanks for sharing your experience! Instead of config.resolve.extensions.push('.json');
config.resolve.extensions.push('.ts');
config.resolve.extensions.push('.tsx'); The problem is that var extensions = config.resolve.extensions;
extensions = extensions.concat(['.json', '.ts', '.tsx']);
// set the new object back on this key
config.resolve.extensions = extensions; Obviously, this will be solved when we have an actual TypeScript loader :). But we need to decide (in general) if we should make this a bit easier, or have people work directly with the webpack config :). See #37 |
Oops ^ ^... there was the missing point. Thanks!! Regarding:
My 5 cents goes for an opinionated way to change configuration in general, through public API methods and allow (through callbacks/strategie or similar) to modify sections in configuration. This mean: Add more methods like in this PR and provide extension points in those methods to allow for modifications. This will allow (for new comers like me) to have the benefits of getting "some fancy configuration" done out of the box (no brainer), but still if "i want to get out of the car and walk, instead drive", I will be able to do that also :) The main value I see in this module is that: I dont want to learn all quirk and dirty things about webpack (unless I need to :D). Public API with verbose/explicit method names will help on that. Thanks again for the help. |
see #50 |
…yan) This PR was merged into the master branch. Discussion ---------- Add support to enableTypescriptLoader Hi, please would you consider adding this to main stream? this add public API to enable TypeScript loader ([ts-loader](https://github.com/TypeStrong/ts-loader)). It follows much of what is described in #9 Cuurrently only add vanilla loader as described in [here](https://github.com/TypeStrong/ts-loader/blob/master/examples/vanilla/webpack.config.js) playing side by side with babel. Future work would be to include also support to `happypack` and `fork-ts-checker-webpack-plugin` Thanks in advance Commits ------- 6d5dee8 Fixing bad merge 35d9e6f Merge branch 'master' into typescript 82e17e3 Remove unnecessary functional test 4d5319d Update yarn.lock with typescript deps 144acd2 Cleaning up unnecessary code. f6bc6e7 Rename to enableTypeScriptLoader facc132 Remove package-lock.json 25b9f18 Remove duplicated default configuration options 23619b2 Add test for error handling on missing ts loader d887a79 Add typescript to missing loader error handling 61370ac Add .ts & .tsx to resolved extension 6ec2b52 Revert "Add .idea directory to gitignore rules" 356aaa2 Make tests check for content in browser context 822ceff Improve tests for compiling .tsx files ae1bea3 Update packages-lock.json file a02d8ab Add .idea directory to gitignore rules 32c2853 Revert accidental version change 846d142 Update tests to take into account refactoring b43f5c9 Refactor to favor configure by callback 1352d1c Add missing extensions to config.resolve 7e8c118 Fix copy'n paste errors 58b7ef7 Add unit and functional test for TypeScript loader fc26e1b Add support to enable TypeScript loader
No description provided.
The text was updated successfully, but these errors were encountered: