[Breaking change] babel-loader => ts-loader in web build builder 8.5.0
See original GitHub issuePlease make sure you have read the submission guidelines before posting an issue
Expected Behavior
Being able to use all Typescript features.
Current Behavior
babel-loader doesn’t support all Typescript features, e.g., const enum, like ts-loader does.
Failure Information (for bugs)
ERROR in /path/to/file.ts
Module build failed (from /path/to/repo/node_modules/babel-loader/lib/index.js):
SyntaxError: /path/to/file.ts: 'const' enums are not supported.
See also https://github.com/babel/babel/issues/8741.
Steps to Reproduce
Just run a web project build that includes const enums.
Context
Please provide any relevant information about your setup:
Version of Nx used: 8.5.0
Relevant commit: https://github.com/nrwl/nx/commit/811c50b Relevant PR: https://github.com/nrwl/nx/pull/1792
Other
The below are other potential breaking changes that are related only in that they were done in the same commit/PR. Happy to move these into separate issues if preferable. In no particular order:
- Filename output was changed (https://github.com/nrwl/nx/commit/811c50b#diff-385b9a18cb3b6256450dc76ddcc286a1R22-R28)
- Differential loading option was removed completely (i.e., would only be an issue those who weren’t using it)
- This is not a breaking change, but something I’d call out: the E2E tests that was checking for successful ES5 transpilation were changed/removed (https://github.com/nrwl/nx/commit/811c50b#diff-cea283cab47e0b2561dd9a84ee5ae998L131-R133 and https://github.com/nrwl/nx/commit/811c50b#diff-a83f7b1d90c9a62dd914ccc27968e4faL38-L41)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
TypeScript loader for webpack - ts-loader - npm
Start using ts-loader in your project by running `npm i ts-loader`. ... Faster Builds; Yarn Plug'n'Play; Babel; Parallelising Builds ...
Read more >Changelog - Cypress Documentation
Read our Migration Guide which explains the breaking changes in more detail. ... The Cypress v10 introduction video will now be skipped if...
Read more >babel-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Error: Cannot resolve module 'babel-loader' - Stack Overflow
I think the issue was that the Babel-loader node package wasn't installed properly or the executable couldn't be located by the application.
Read more >Build Standardized Applications with Webpack5 + React + TS ...
//_webpack.config.js_ ... rules: [ { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', }, { test: /\.css$/, use: ['style-loader' ...
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 Free
Top 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

@atifsyedali Hey, thanks for chiming in. I don’t think it’ll quite work with using
transpileOnlysince depending on what babel-plugins you use, it may not transpile using justtsc. I think we should be able to get support parity with prevousts-loadersetup.Our codebase broke wrt namespaces, const enums, decorators, and more.
@jaysoo Can’t we have the Typescript compiler in transpileOnly mode pipe output to Babel, with the option of disabling Babel altogether? Then in parallel use the ForkTsChecker plugin.
This may seem like it may make the builds slower, but ‘@babel/preset-typescript’ is already installed in babel, which you can now remove if you first pipe through tsc before babel.