React.v17 + TypeScript 導入紀錄(稿)

Prerequisites 前置準備

  • Node.js Version 12.18.2+

  • Npm Version 6.14+ (npm is installed with Node.js)

    You can check to see if and what versions of node.js and npm you have installed by entering node -v and npm -v, respectively, in the terminal.

  • check the .NET Framework version

  • check the .NET Core version

    • dotnet --version

    • dotnet --info

    • dotnet --list-runtimes

    • dotnet --list-sdks

安裝順序

一些成果紀錄

安全性相關 - JavaScript Release code 混淆效果

Release/build 模式下的程式碼會做混淆,當然也有分割成無數個chunk。如圖:

就算 [Pretty-print] 也難以閱讀。如圖:

一些心得與注意事項

React.v16 與 v17 的開發組態有些微不同。

關閉 Visual Stuido 2019 附屬的TypeScript編譯功能

因此案例專案有兩套 TypeScript 運作,一個是 Visual Studio 本身提供、一個是 npm 提供。我們使用 npm TypeScript,故關閉 VS TypeScript 以避衝突混亂。

釋放 node.exe 資源

在此案例中,Visual Studo 2019 的資源釋放並不徹底,使得 node.exe 一直留在記憶體中,故需下指令強制關閉node.exe以釋放資源,如下:

C:\> taskkill /IM node.exe /F
強制關閉 node.exe 以釋放資源
node.exe 未被釋放問題

參考文件

Last updated