webpack compiling twice on startup when importing a file within a typescript react setup
See original GitHub issueBug report
What is the current behavior?
Working on a TypeScript React project when running webpack the compilation happens twice at startup. This happens when a file is being imported from the root react index.tsx
.
Not sure if its similar to https://github.com/webpack/webpack/issues/13618?
If the current behavior is a bug, please provide the steps to reproduce.
- https://github.com/bahtou/issues/tree/webpack-rebuild
- follow the readme
you should be able to see two rebuilds
👀 1 . compilation afterEmit 2021-11-18T22:01:58.573Z
👀 1 . compilation is done 2021-11-18T22:01:58.575Z
👀 2 . compilation afterEmit 2021-11-18T22:01:58.872Z
👀 2 . compilation is done 2021-11-18T22:01:58.872Z
What is the expected behavior?
compilation should only run once
Other relevant information: webpack version: 5.64.1 Node.js version: v14.18.1 Operating System: OSX Additional tools: none
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Compiling and bundling TypeScript libraries with Webpack
Since I started working on UI-Router React I've been enjoying writing TypeScript. There are both advantages and disadvantages working with a typed and ......
Read more >Using webpack with TypeScript - LogRocket Blog
Learn how to use webpack to compile TypeScript to JavaScript and bundle source code into a single JavaScript file.
Read more >Code splitting with webpack and TypeScript - Spencer Miskoviak
Photo by Brendon Thompson. Code splitting is an approach to break apart a single large file into many smaller files.
Read more >Setting TypeScript For Modern React Projects Using Webpack
There are several ways to set up TypeScript in a React Project. In this tutorial, we'll be covering just two. Method 1: Create...
Read more >Integrating TypeScript with Webpack | by Uday Hiwarale
When you compile this project, TypeScript has to run a full type analysis on all the .ts files included in the Webpack compilation...
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
should be fixed by https://github.com/webpack/webpack/releases/tag/v5.64.2
Yep, it is bug