webpack ts-loader官方github及其兼容性


點擊 網頁https://webpack.docschina.org/loaders/ 中的 “ts-loader”鏈接:

 

 

 到達ts-loader官方github (https://github.com/TypeStrong/ts-loader#running),搜索“Compatibility”,看到ts-loader的兼容性

 

Compatibility

    • TypeScript: 3.6.3+
    • webpack: 4.x+ (please use ts-loader 3.x if you need webpack 2 or 3 support)
    • node: 6.11.5 minimum (aligned with webpack 4)

看到 ts-loader的配置

 看到 baseUrl / paths module resolution

baseUrl / paths module resolution

If you want to resolve modules according to baseUrl and paths in your tsconfig.json then you can use the tsconfig-paths-webpack-plugin package. For details about this functionality, see the module resolution documentation.

This feature requires webpack 2.1+ and TypeScript 2.0+. Use the config below or check the package for more information on usage.

const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); module.exports = { ... resolve: { plugins: [new TsconfigPathsPlugin({ configFile: "./path/to/tsconfig.json" })] } ... }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM