Rollup-plugin-typescript2: TSv3.4ではコンパむルが非垞に遅い

䜜成日 2019幎04月09日  Â·  21コメント  Â·  ゜ヌス: ezolenko/rollup-plugin-typescript2

䜕が起こり、なぜそれが間違っおいるのか

TSをv3.4.2にアップグレヌドするず、コンパむル時間が非垞に遅くなりたす。 TS v3.3では私のプロゞェクトは玄20秒で構築され、TSv3.4では玄500䞇かかりたす。

clean: trueで詊し、 typescript: require('typescript')を远加しようずし、 rollupず関連するすべおのプラグむンをアップグレヌドしようずしたした。毎回、同じ結果でコンパむルに時間がかかりたす。 。

泚 tsc -p tsconfig.prod.json盎接実行するず、distを出力するのに10秒もかかりたせん。

環境

バヌゞョン

  • タむプスクリプトv3.4.2
  • ロヌルアップv1.6.0
  • rollup-plugin-typescript2v0.19.2

rollup.config.js

  {
    input: 'src/index.ts',
    output: [
      { file: pkg.main, format: 'cjs' },
      { file: pkg.module, format: 'es' },
    ],
    plugins: [
      external({ includeDependencies: true }),
      resolve(),
      typescript({
        tsconfig: './tsconfig.prod.json',
        rollupCommonJSResolveHack: true,
      }),
      commonjs(),
      filesize(),
    ],
  }

tsconfig.json


tsconfig.json

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es5",
    "jsx": "react",
    "esModuleInterop": true,
    "lib": ["dom", "es2017"],
    "moduleResolution": "node",
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": false,
    "downlevelIteration": true
  },
  "include": ["src/**/*", "types/**/*"]
}


tsconfig.prod.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./dist",
    "noUnusedLocals": true,
    "sourceMap": true,
    "declaration": true
  },
  "exclude": ["src/doc", "**/stories.tsx", "**/test.tsx", "**/fixture.ts"]
}

package.json

    "rollup": "^1.6.0",
    "rollup-plugin-commonjs": "^9.2.1",
    "rollup-plugin-filesize": "^6.0.1",
    "rollup-plugin-node-resolve": "^4.0.1",
    "rollup-plugin-peer-deps-external": "^2.2.0",
    "rollup-plugin-typescript2": "^0.19.2",
    "typescript": "^3.4.2"

詳现3のプラグむン出力


出力

rpt2: typescript version: 3.4.2
rpt2: tslib version: 1.9.3
rpt2: rollup-plugin-typescript2 version: 0.19.2
rpt2: plugin options:
{
    "tsconfig": "./tsconfig.prod.json",
    "rollupCommonJSResolveHack": true,
    "clean": true,
    "verbosity": 3,
    "typescript": "version 3.4.2",
    "check": true,
    "cacheRoot": "/Users/yannpringault/git/PayFit/components/.rpt2_cache",
    "include": [
        "*.ts+(|x)",
        "**/*.ts+(|x)"
    ],
    "exclude": [
        "*.d.ts",
        "**/*.d.ts"
    ],
    "abortOnError": true,
    "useTsconfigDeclarationDir": false,
    "tsconfigOverride": {},
    "transformers": [],
    "tsconfigDefaults": {},
    "objectHashIgnoreUnknownHack": false
}
rpt2: rollup config:
{
    "chunkGroupingSize": 5000,
    "experimentalCacheExpiry": 10,
    "inlineDynamicImports": false,
    "input": "src/index.ts",
    "perf": false,
    "plugins": [
        {
            "name": "peer-deps-external"
        },
        {
            "name": "node-resolve"
        },
        {
            "name": "rpt2"
        },
        {
            "name": "commonjs"
        },
        {
            "name": "filesize"
        }
    ]
}
rpt2: built-in options overrides: {
    "noEmitHelpers": false,
    "importHelpers": true,
    "noResolve": false,
    "noEmit": false,
    "inlineSourceMap": false,
    "outDir": "/Users/yannpringault/git/PayFit/components/.rpt2_cache/placeholder",
    "moduleResolution": 2,
    "allowNonTsExtensions": true,
    "declarationDir": "/Users/yannpringault/git/PayFit/components"
}
rpt2: parsed tsconfig: {
    "options": {
        "module": 6,
        "target": 1,
        "jsx": 2,
        "esModuleInterop": true,
        "lib": [
            "lib.dom.d.ts",
            "lib.es2017.d.ts"
        ],
        "moduleResolution": 2,
        "rootDir": "/Users/yannpringault/git/PayFit/components/src",
        "forceConsistentCasingInFileNames": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "suppressImplicitAnyIndexErrors": true,
        "noUnusedLocals": true,
        "downlevelIteration": true,
        "outDir": "/Users/yannpringault/git/PayFit/components/.rpt2_cache/placeholder",
        "sourceMap": true,
        "declaration": true,
        "configFilePath": "/Users/yannpringault/git/PayFit/components/./tsconfig.prod.json",
        "noEmitHelpers": false,
        "importHelpers": true,
        "noResolve": false,
        "noEmit": false,
        "inlineSourceMap": false,
        "allowNonTsExtensions": true,
        "declarationDir": "/Users/yannpringault/git/PayFit/components"
    },
    "fileNames": [
        "/Users/yannpringault/git/PayFit/components/src/index.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/index.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/Alert/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Alert/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Avatar/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Avatar/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/AvatarGroup/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/AvatarGroup/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Badge/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Badge/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Button/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Button/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Checkbox/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Checkbox/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/CheckboxGroup/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/CheckboxGroup/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/DatePicker/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/DatePicker/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/DatePicker/Popin/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Dropdown/MenuContext.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/Dropdown/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Dropdown/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Dropdown/DropdownItem/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Dropdown/DropdownItem/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Field/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Field/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Icon/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Icon/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Input/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Input/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Layout/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Legend/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Legend/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Loader/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Loader/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/ProgressBar/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/ProgressBar/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/ProgressCircle/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/ProgressCircle/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/RadioGroup/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/RadioGroup/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Select/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Select/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Steps/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Steps/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Body.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Cell.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Footer.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Header.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/HeaderCell.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/HeaderRow.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Limit.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Table/components/Row.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/TableGroup/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/TableGroup/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Tag/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Tag/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Text/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Toggle/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Toggle/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Tooltip/index.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/Tooltip/style.tsx",
        "/Users/yannpringault/git/PayFit/components/src/components/_helpers/colors.test.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/_helpers/colors.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/_helpers/react.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/_helpers/string.test.ts",
        "/Users/yannpringault/git/PayFit/components/src/components/_helpers/string.ts",
        "/Users/yannpringault/git/PayFit/components/src/primitives/_helpers.tsx",
        "/Users/yannpringault/git/PayFit/components/src/primitives/box.tsx",
        "/Users/yannpringault/git/PayFit/components/src/primitives/text.tsx",
        "/Users/yannpringault/git/PayFit/components/src/utils/index.ts",
        "/Users/yannpringault/git/PayFit/components/src/utils/colors/index.ts",
        "/Users/yannpringault/git/PayFit/components/src/utils/shadows/index.ts",
        "/Users/yannpringault/git/PayFit/components/src/utils/shadows/test.ts",
        "/Users/yannpringault/git/PayFit/components/src/utils/zIndex/index.ts",
        "/Users/yannpringault/git/PayFit/components/types/index.d.ts",
        "/Users/yannpringault/git/PayFit/components/types/modules.d.ts"
    ],
    "typeAcquisition": {
        "enable": false,
        "include": [],
        "exclude": []
    },
    "raw": {
        "extends": "./tsconfig.json",
        "compilerOptions": {
            "outDir": "./dist",
            "noUnusedLocals": true,
            "sourceMap": true,
            "declaration": true
        },
        "exclude": [
            "src/doc",
            "**/stories.tsx",
            "**/test.tsx",
            "**/fixture.ts"
        ],
        "compileOnSave": false,
        "include": [
            "src/**/*",
            "types/**/*"
        ]
    },
    "errors": [],
    "wildcardDirectories": {
        "/users/yannpringault/git/payfit/components/src": 1,
        "/users/yannpringault/git/payfit/components/types": 1
    },
    "compileOnSave": false,
    "configFileSpecs": {
        "includeSpecs": [
            "src/**/*",
            "types/**/*"
        ],
        "excludeSpecs": [
            "src/doc",
            "**/stories.tsx",
            "**/test.tsx",
            "**/fixture.ts"
        ],
        "validatedIncludeSpecs": [
            "src/**/*",
            "types/**/*"
        ],
        "validatedExcludeSpecs": [
            "src/doc",
            "**/stories.tsx",
            "**/test.tsx",
            "**/fixture.ts"
        ],
        "wildcardDirectories": {
            "/users/yannpringault/git/payfit/components/src": 1,
            "/users/yannpringault/git/payfit/components/types": 1
        }
    }
}
rpt2: included:
'[
    "*.ts+(|x)",
    "**/*.ts+(|x)"
]'
rpt2: excluded:
'[
    "*.d.ts",
    "**/*.d.ts"
]'

blocked help wanted

最も参考になるコメント

@ezolenko返信が遅くなっおすみたせん

clean: trueを入れお、rtp2を0.20.1アップグレヌドしたした。 結果は次のずおりです。

TS 3.3.3333

build -> 18s
tsc   -> 14.39s

TS 3.3.4000

build -> 17.3s
tsc   -> 14.39s

TS3.4.1

build -> 5m 25.1s
tsc   -> 21.26s

TS 3.4.3

build -> 5m 52.7s
tsc   -> 21.57s

さらに、TSリポゞトリにこの問題があり、関連しおいるようですが、 @types/styled-componentsがv4.1.4固定されおいるため、私の堎合はカバヌしおいたせん。

さらに情報が必芁な堎合はお知らせください。


楜しみのために、最新の3.5ビルドも詊したした。

TS 3.5.0-dev.20190413

build -> 1m 23.5s
tsc   -> 18.84s

党おのコメント21件

私は同じ問題を抱えおいたす。 TSを3.3.4000から3.4.3にバンプするず、 24sから345sた

再珟しようずするず、最初は速床が䜎䞋したしたが、 clean: trueを䜿甚しお、typescriptバヌゞョン間を䜕床か行ったり来たりするず、クリヌンビルドの違いがわかりたせん...

clean: true 、rtp2を最新0.20.1たたはマスタヌに曎新しお、ts3.3ずts3.4でビルドの時間を数回続けお蚈るこずができたすか

@ezolenko返信が遅くなっおすみたせん

clean: trueを入れお、rtp2を0.20.1アップグレヌドしたした。 結果は次のずおりです。

TS 3.3.3333

build -> 18s
tsc   -> 14.39s

TS 3.3.4000

build -> 17.3s
tsc   -> 14.39s

TS3.4.1

build -> 5m 25.1s
tsc   -> 21.26s

TS 3.4.3

build -> 5m 52.7s
tsc   -> 21.57s

さらに、TSリポゞトリにこの問題があり、関連しおいるようですが、 @types/styled-componentsがv4.1.4固定されおいるため、私の堎合はカバヌしおいたせん。

さらに情報が必芁な堎合はお知らせください。


楜しみのために、最新の3.5ビルドも詊したした。

TS 3.5.0-dev.20190413

build -> 1m 23.5s
tsc   -> 18.84s

あなたが芋぀けたその問題https://github.com/Microsoft/TypeScript/issues/30663ず、3.5-devが5倍速くなったずいう事実は、圌らがLanguageServer APIで䜕かをしたず私に思わせたす。 これは、rpt2がコンパむルの䞀郚ずしお䜿甚するAPIであり、IDEのタむプチェッカヌが䜿甚しおいるものですこれがWebStormがタむムアりトする理由などです。

プロゞェクトが圱響を受ける型構造を他の堎所で䜿甚しおいる可胜性があるため、 styled-components固定しおも効果はありたせん。 そのため、たずえばrpt2自䜓をビルドするずきに倧きな速床䜎䞋は芋られたせん。

3.5の最終リリヌスを埅぀ず思いたす。

ずころで、 check: falseオプションでビルドしおみおください

これが3.5リリヌスで修正されおいるかどうかを誰かが確認したしたか

@ tomasro27私にずっおも、6 3.6.0-dev.20190621 でもありたせん。 3.3未満がただ最速のようです。

3.5の方が少し速いようですが、それでももっず良いかもしれたせん

これに関する曎新はありたすか ただTSによっおブロックされおいるように芋えたすか

ええ、この終わりから䜕もできないず思いたす。 どなたでもお詊しいただけたす:)

+1
3.5.3も私たちにずっお非垞に遅い

check: falseはうたく機胜しおいたす。

しかし、問題は、コンパむル゚ラヌが発生しないこずですvscodeを䜿甚するず、゚ラヌが衚瀺されたす😄。

少なくずも、CSSJSでに取り組んでいるずきはcheck: false実行できたす。 👍

@ezolenko正確なtypescriptapi呌び出しがビルドの速床を䜎䞋させる原因を知っおいたすか :)

@ZainlessBrombieいいえ、私が知っおいるこずはすべおこのスレッドにありたす。 リンクされおいるTypescriptの問題はおそらく関連しおいたすが、盎接的な原因ではありたせん3.5以降で修正する必芁があるず蚀われおいるため、明らかにそうではありたせん。

プロゞェクトのビルドが遅い堎合は、可胜であればts 3.3の方が実際に速いかどうかを確認しおください。問題はタむプスクリプトではなく、別の問題である可胜性がありたす。

わかりたした、ありがずう。 私がそれに近づいたら、これはいわば頭をぶ぀けおも構わないず思っおいる壁かもしれたせん:)

線集この問題は、スタむル付きコンポヌネントをむンポヌトするファむルでのみ発生したす。
たた、Typescriptのドキュメントはひどいです

タむプスクリプトをプロファむリングするず、問題の原因が、スタむル蚭定されたコンポヌネントが持぀これらの非垞に倧きなナニオンであるこずが明らかになりたす。 これを修正する唯䞀の堎所はtypescriptです。ただし、typescriptを取埗しおモゞュヌルの解像床をキャッシュする方法がない限りそうすべきです。

私は実際にはnodeModuleNameResolverの呌び出しでモゞュヌル解決キャッシュを䜿甚しおいたせん https 

それがtsにデフォルトのものを䜿甚させるのか、それずもたったく䜿甚しないのかわからない。

はい私はそのTODOを芋たした:)
残念ながら、䜿甚時にモゞュヌル解決キャッシュをデバッグするず、䜕らかの理由でリベヌスはキャッシュされたすが、スタむル蚭定されたコンポヌネントはキャッシュされないこずが瀺されたす。 それらの内郚キャッシュを枡したす...

珟圚、ラむブラリのCコヌドベヌスをTypeScriptに移行䞭であり、バンドルにRollupを䜿甚しおいたす。 以前はカスタムC> Haxe> JavaScriptツヌルチェヌンを䜿甚しおいたした。 残念ながら、新しいTypeScriptコヌドベヌスのコンパむル速床にもかなりの苊しみがあり、開発が非垞に困難になっおいたす。

可胜であれば、プロファむリングレポヌトを生成できる堎合は、それらを提䟛させおいただきたす。

ここに私のプロゞェクトぞのいく぀かの掞察がありたす

通垞、私はいく぀かのAST倉換を行うためにttypescriptを䜿甚しおいたす。
コヌド行〜50000

rollup -c rollup.config.ts 〜9-10秒
rollup -c rollup.config.ts -w初期コンパむル 〜9-10秒
rollup -c rollup.config.ts -w1぀のTSファむルに1぀のアラヌトを远加 
rollup -c rollup.config.ts -wアラヌトを再床削陀 

tsc --version 3.8.3
tsc --project tsconfig.json 〜6-7秒
tsc --project tsconfig.json -w初期コンパむル 〜6-7秒
tsc --project tsconfig.json -w1぀のTSファむルに1぀のアラヌトを远加 〜0.1-0.2sec
tsc --project tsconfig.json -wアラヌトを再床削陀 〜0.1-0.2sec

ttsc --version 3.8.3
ttsc --project tsconfig.json 〜7-8sec
ttsc --project tsconfig.json -w初期コンパむル 〜6-7秒
ttsc --project tsconfig.json -w1぀のTSファむルに1぀のアラヌトを远加 〜0.1-0.2sec
ttsc --project tsconfig.json -wアラヌトを再床削陀 〜0.1-0.2sec

むンクリメンタルビルドはtsconfigでアクティブです。

むンクリメンタル/りォッチビルドがフルビルドの2倍かかるこずは私には非垞に珍しいようです。

tiがテストになるず、私の環境では物事がおかしくなりそうです。 私はカルマずこのtypescriptプラグむンでロヌルアップを接続したした。 ご存知かもしれたせんが、各テストスむヌトには独自のバンドルがありたす。぀たり、䞊蚘の数が山積みになっおいたす。 メモリは時間の経過ずずもに> 2GBに増加したす。 数分埌でも、テストの実行は実際には開始されたせん。 これは、各シングルnpm run testたす。

テスト生成の「Generatingbundlefor ...」領域に到達するず、ばかげた数が衚瀺されたす。
パヌサヌクラスの1぀の簡単なテストを含むFile01.test.tsには15秒かかりたす
11個のXML解析テストを含むFile02.test.tsには2.5分かかりたす
File03.test.tsは5分埌にも完了したせんでした。

この問題がどこで発生する可胜性があるのか​​、それが本圓にロヌルアップのtypescriptモゞュヌルが原因であるのかどうかはわかりたせんが、これが私が関係しおいる最も可胜性の高い問題のようです。

私のリポゞトリは非垞に倧きく耇雑なので、構成の詳现は共有したせんでした。 誰かがそれらを収集する方法を教えおくれれば、ログ/プロファむリング結果などを提䟛できおうれしいです。プロゞェクト党䜓の状況を反映した新しい単玔な独立したリポゞトリをセットアップしようずしたすが、問題が続くずは玄束できたせん。

@ Danielku15あなたの䞻な問題は、C ++からではなくCから移行しおいるこずです:)

このプラグむンは、typescript独自のむンクリメンタルビルドを明瀺的に䜿甚しおいたせんこれは開始時に存圚しおいたせんでした。

@rollup/plugin-typescript https://github.com/rollup/plugins/tree/master/packages/typescriptを詊すこずができたす。圌らは私が思うに異なるアプロヌチを䜿甚し、異なる番号を䞎える可胜性がありたす。

もう1぀のオプションは、ロヌルアップチェヌンからtypescriptコンパむルを実行しnpmなどのプリビルドステップずしお、代わりに結果のjsをロヌルアップにフィヌドするこずです。 りォッチビルドは興味深いものですが、りォッチモヌドでtscずロヌルアップを開始でき、プロゞェクトが正しく構成されおいれば、正垞に機胜するず思いたす。

䞻な問題は、C ++からではなくCから移行しおいるこずです。

オフトピックC ++フレヌムワヌク/ラむブラリをTypeScriptに移行するかどうかはわかりたせん。 マクロずテンプレヌトC ++開発者が奜む傟向があるの䜿甚によっおは、移行䞭に状況が悪化する可胜性がありたす😅幞いなこずに、私のCコヌドベヌスは垞に他の蚀語ぞのクロスコンパむルを可胜にするスタむルに調敎されおいたため、コヌド構造から結果は非垞に受け入れられたす。 オヌバヌヘッドを枛らすためにモゞュヌルを線成する方法をもう少しよく理解する必芁がありたす。 😊

このプラグむンは、typescript独自のむンクリメンタルビルドを明瀺的に䜿甚しおいたせんこれは開始時に存圚しおいたせんでした。

これは興味深いですが、このプラグむンには独自のカスタム「むンクリメンタル」ビルド戊略がありたすか これは、りォッチを䜿甚するずきにフルクリヌンビルドが゜ヌスの倉曎よりも時間がかかる理由を説明しおいる可胜性がありたす。 タむプスクリプトのコンパむルは倚かれ少なかれ安定しおおり、このプラグむンがむンクリメンタル曎新をただ利甚できないのは残念ですが、タむプスクリプトコンパむラで費やされた時間は安定しおいるず思いたす。 しかし、ロヌルアップに費やす時間はさたざたなようです。 これだけが、クリヌンビルドがりォッチモヌドでのコヌド倉曎よりも速いこずを私に説明しおいたす。

@ rollup / plugin-typescriptを詊すこずができたす...

ヒントをありがずう、私はそれが改善するかどうかを確かめるためにそれを詊しおみたす。

別のオプションは、ロヌルアップチェヌンからtypescriptコンパむルを行うこずです

私は最初にそのような蚭定をしおいたしたが、開発䞭にビルドを「監芖」するために途䞭でそれを萜ずしたした。 2぀のツヌルを個別に「監芖」しおパむプラむンを接続できる堎合は、もう䞀床詊しおみたす。 👍

曎新1ロヌルアップでチェヌンされたtscを呌び出すこずで、コンパむルおよびテスト環境党䜓をセットアップするこずができたした。 tsconfigパスを正しく解決するには、独自のロヌルアッププラグむンを䜜成する必芁がありたしたが、その埌は正垞に機胜しおいたした。

クリヌンコンパむル9秒、りォッチコンパむル0.5〜1秒、Karma + Rollupによるテストも実行されおいたす各テストスむヌトのバンドルが生成されるため、コンパむルには少し時間がかかりたす。

このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡