TSλ₯Ό v3.4.2λ‘ μ κ·Έλ μ΄λνλ©΄ μ»΄νμΌ μκ°μ΄ λ§€μ° λ립λλ€. TS v3.3μ μ¬μ©νλ©΄ λ΄ νλ‘μ νΈκ° ~ 20 μ΄μ λΉλλκ³ TS v3.4λ₯Ό μ¬μ©νλ©΄ ~ 5mnμ΄ κ±Έλ¦½λλ€.
clean: true
λ‘ μλνκ³ typescript: require('typescript')
μ μΆκ°νλ €κ³ νκ³ rollup
λ° λͺ¨λ κ΄λ ¨ νλ¬κ·ΈμΈμ μ
κ·Έλ μ΄λνλ €κ³ νμ΅λλ€. λ§€λ² λμΌν κ²°κ³Όλ₯Ό μ»΄νμΌνλ λ° λ§μ μκ°μ΄ 걸립λλ€. .
μ°Έκ³ : tsc -p tsconfig.prod.json
μ§μ μ€ννλ©΄ distλ₯Ό μΆλ ₯νλ λ° 10 μ΄λ κ±Έλ¦¬μ§ μμ΅λλ€.
{
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
{
"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"]
}
"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"
μ°μΆ
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"
]'
λλ κ°μ λ¬Έμ κ° μμ΅λλ€. TSλ₯Ό 3.3.4000
μμ 3.4.3
λ²ν ν λ 24s
μμ 345s
3.4.3
λλ μ¬νμ μλνκ³ μ²μμλ μλκ° λλ €μ§λ κ²μ 보μμ§λ§ clean: true
νκ³ typescript λ²μ μ μ¬λ¬ λ² μλ€λ‘ μ΄λνλ©΄ μ§κΈ ν΄λ¦° λΉλμ μ°¨μ΄κ° 보μ΄μ§ μμ΅λλ€.
clean: true
μ μ€μ νκ³ rtp2λ₯Ό μ΅μ λ²μ (0.20.1 λλ λ§μ€ν°)μΌλ‘ μ
λ°μ΄νΈνκ³ ts 3.3 λ° ts 3.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
TS 3.4.1
build -> 5m 25.1s
tsc -> 21.26s
TS 3.4.3
build -> 5m 52.7s
tsc -> 21.57s
λνμ΄ μ΄ λ¬Έμ μ κ΄λ ¨λ κ²μΌλ‘ 보μΈλ€λ TSμ repoμνμ§λ§ λλμ΄ @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μ typecheckerκ° μ¬μ©νλ κ²μ
λλ€ (μ΄κ²μ΄ WebStormμ΄ μκ° μ΄κ³Όλλ μ΄μ μ
λλ€).
νλ‘μ νΈμμ μν₯μλ°λ μ ν ꡬ쑰λ₯Ό λ€λ₯Έ κ³³μμ μ¬μ©νκ³ μμ μ μμΌλ―λ‘ styled-components
κ³ μ ν΄λ λμμ΄λμ§ μμ΅λλ€. μλ₯Ό λ€μ΄ rpt2 μ체λ₯Ό λΉλ ν λ ν° μλ μ νκ° λ³΄μ΄μ§ μλ μ΄μ μ
λλ€.
μ΅μ’ 3.5 릴리μ€λ₯Ό κΈ°λ€λ¦΄ κ² κ°μ΅λλ€.
btw, check: false
μ΅μ
μΌλ‘ λΉλ ν΄λ³΄μΈμ.
μ΄κ²μ΄ 3.5 릴리μ€λ‘ μμ λμλμ§ νμΈν μ¬λμ΄ μμ΅λκΉ?
@ tomasro27 λλ μλκ³ 6 ( 3.6.0-dev.20190621
). 3.3 λ―Έλ§μ΄ μ¬μ ν κ°μ₯ λΉ λ₯Έ κ² κ°μ΅λλ€.
3.5κ° μ‘°κΈ λ λΉ λ₯Έ κ² κ°μ§λ§ μ¬μ ν λ μ’μ μ μμ΅λλ€.
μ΄κ²μ λν μ λ°μ΄νΈκ° μμ΅λκΉ? μμ§λ TSμ μν΄ μ°¨λ¨ λ κ² κ°μ΅λκΉ?
λ€, μ΄μͺ½μμ ν μμλ μΌμ΄ μλ€κ³ μκ°ν©λλ€. λꡬλ μλν΄ λ³Ό μ μμ΅λλ€ :)
+1
3.5.3μ μ°λ¦¬μκ²λ λ§€μ° λ립λλ€.
check: false
μ΄ (κ°) μ μλν©λλ€.
κ·Έλ¬λ λ¬Έμ λ μ»΄νμΌ μ€λ₯κ° λ°μνμ§ μλλ€λ κ²μ λλ€ (vscodeλ₯Ό μ¬μ©νλ©΄ μ€λ₯κ° νμλ©λλ€ π).
μ μ΄λ CSS μμ
μ ν λ check: false
ν μ μμ΅λλ€ (JSμμ). π
@ezolenko μ νν typescript api νΈμΆλ‘ μΈν΄ λΉλ μλκ° λλ €μ§λ κ²μ μκ³ μμ΅λκΉ? :)
@ZainlessBrombie μλ, λ΄κ° μλ λͺ¨λ κ²μμ΄ μ€λ λμ μμ΅λλ€. μ°κ²°λ Typescript λ¬Έμ λ ββμλ§λ κ΄λ ¨μ΄μμ μ μμ§λ§ μ§μ μ μΈ μμΈμ μλλλ€ (3.5+μμ μμ λμ΄μΌνλ€κ³ λ§νκ³ λΆλͺ ν κ·Έλ μ§ μκΈ° λλ¬Έμ λλ€).
νλ‘μ νΈμ λλ¦° λΉλκ°μλ κ²½μ° κ°λ₯ν κ²½μ° ts 3.3μ΄ μ€μ λ‘ λ λΉ λ₯Έμ§ νμΈνμμμ€. λ¬Έμ λ typescriptκ° μλλΌ λ€λ₯Έ κ²μΌ μ μμ΅λλ€.
κ³ λ§μμ. λ΄κ° κ·Έκ²μ μ κ·Όνλ©΄ μ΄κ²μ λ²½μ΄ λ μ μμ΅λλ€.
νΈμ§ :μ΄ λ¬Έμ λ 보μ΄λλλ‘ μ€νμΌμ΄ μ§μ λ κ΅¬μ± μμλ₯Ό κ°μ Έ μ€λ νμΌμμλ§ λ°μν©λλ€.
λν Typescript λ¬Έμλ λμ°ν©λλ€.
μ ν μ€ν¬λ¦½νΈλ₯Ό νλ‘νμΌ λ§νλ©΄ μ€νμΌμ΄ μ§μ λ κ΅¬μ± μμμμλ μ΄λ¬ν λ§€μ° ν° κ²°ν©μ΄ λ¬Έμ μ μμΈμ μ μ μμ΅λλ€. μ΄λ₯Ό κ³ μΉ μμλ μ μΌν μ₯μλ typescriptλ₯Ό μΊμ λͺ¨λ ν΄μλλ‘ κ°μ Έμ¬ μμλ λ°©λ²μ΄μλ ν typescriptμ λλ€.
μ€μ λ‘ nodeModuleNameResolver νΈμΆμμ λͺ¨λ νμΈ μΊμλ₯Ό μ¬μ©νμ§ μκ³ μμ΅λλ€ : https://github.com/ezolenko/rollup-plugin-typescript2/blob/b7c7389dcdf168715669520128ca656d6e940111/src/index.ts#L148
κ·Έκ²μ΄ tsκ° κΈ°λ³Έκ°μ μ¬μ©νλμ§ λλ μ ν μ¬μ©νμ§ μλμ§ νμ€νμ§ μμ΅λλ€.
λ€ TODOλ₯Ό λ΄€μ΄μ :)
λΆννλ λͺ¨λ ν΄μλ μΊμλ₯Ό μ¬μ©ν λ λλ²κΉ
νλ©΄ μ΄λ€ μ΄μ λ‘ λ rebassλ₯Ό μΊμνμ§λ§ μ€νμΌμ΄ μ§μ λ κ΅¬μ± μμκ° μλ κ²μΌλ‘ λνλ©λλ€. κ·Έκ²μ κ·Έλ€μ μν΄ λ΄λΆ μΊμλ₯Ό μ λ¬ν©λλ€ ...
νμ¬ λΌμ΄λΈλ¬λ¦¬μ 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 κ°μ κ²½κ³ μΆκ°) : ~ 20 μ΄
rollup -c rollup.config.ts -w (κ²½κ³ λ€μ μ κ±°) : ~ 20 μ΄
tsc-λ²μ : 3.8.3
tsc --project tsconfig.json : ~ 6-7 μ΄
tsc --project tsconfig.json -w (μ΄κΈ° μ»΄νμΌ) : ~ 6-7sec
tsc --project tsconfig.json -w (1 κ°μ TS νμΌμ 1 κ°μ κ²½κ³ μΆκ°) : ~ 0.1-0.2 μ΄
tsc --project tsconfig.json -w (μλ¦Ό λ€μ μ κ±°) : ~ 0.1-0.2 μ΄
ttsc-λ²μ : 3.8.3
ttsc --project tsconfig.json : ~ 7-8 μ΄
ttsc --project tsconfig.json -w (μ΄κΈ° μ»΄νμΌ) : ~ 6-7 μ΄
ttsc --project tsconfig.json -w (1 κ°μ TS νμΌμ 1 κ°μ κ²½κ³ μΆκ°) : ~ 0.1-0.2 μ΄
ttsc --project tsconfig.json -w (μλ¦Ό λ€μ μ κ±°) : ~ 0.1-0.2 μ΄
μ¦λΆ λΉλλ tsconfigμμ νμ±νλ©λλ€.
μ¦λΆ / κ°μ λΉλκ° μ 체 λΉλλ³΄λ€ λ λ°°λ λ§μ μκ°μ΄ μμλλ κ²μ λ§€μ° λλ¬Έ κ² κ°μ΅λλ€.
ν
μ€νΈμ κ΄ν΄μλ λ΄ νκ²½μμ μν©μ΄ λ―Έμ³κ°λ κ² κ°μ΅λλ€. λλ karmaμμ΄ typescript νλ¬κ·ΈμΈκ³Ό ν¨κ» λ‘€μ
μ μ°κ²°νλ€. μμλ€μνΌ : κ° ν
μ€νΈ μ€μνΈλ μ체 λ²λ€μ μ»μ΅λλ€. μ΄λ μμ μ«μκ° μμ΄λ κ²μ μλ―Έν©λλ€. λ©λͺ¨λ¦¬λ μκ°μ΄ μ§λ¨μ λ°λΌ> 2GBκΉμ§ μ¦κ°ν©λλ€. λͺ λΆ νμλ ν
μ€νΈ μ€νμ΄ μ€μ λ‘ μμλμ§ μμ΅λλ€. μ΄κ²μ κ° npm run test
ν©λλ€.
ν
μ€νΈ μΈλμ "Generating bundle for ..."μμμ λλ¬νλ©΄ μμ²λκ² λμ μ«μλ₯Ό λ³Ό μ μμ΅λλ€.
νμ ν΄λμ€μ κ°λ¨ν ν
μ€νΈ 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)λ₯Ό μλν΄ λ³Ό μ μμΌλ©°, μ μκ°μ λ€λ₯Έ μ κ·Ό λ°©μμ μ¬μ©νκ³ λ€λ₯Έ μ«μλ₯Ό μ€ μ μμ΅λλ€.
λ λ€λ₯Έ μ΅μ μ λ‘€μ μ²΄μΈ (npm λ±μ μ¬μ λΉλ λ¨κ³)μμ typescript μ»΄νμΌμ μννκ³ κ²°κ³Ό jsλ₯Ό λμ λ‘€μ μ 곡κΈνλ κ²μ λλ€. μκ³ λΉλλ ν₯λ―Έλ‘μΈ κ²μ λλ€.νμ§λ§ μκ³ λͺ¨λμμ tscμ λ‘€μ μ μμν μ μκ³ νλ‘μ νΈκ° μ¬λ°λ₯΄κ² ꡬμ±λμ΄ μμΌλ©΄ μλν©λλ€.
μ£Όμ λ¬Έμ λ C ++κ° μλ C #μμ λ§μ΄κ·Έλ μ΄μ νλ€λ κ²μ λλ€.
Off-Topic : C ++ νλ μ μν¬ / λΌμ΄λΈλ¬λ¦¬λ₯Ό TypeScriptλ‘ λ§μ΄κ·Έλ μ΄μ νκ³ μΆμμ§ νμ€νμ§ μμ΅λλ€. 맀ν¬λ‘ λ° ν νλ¦Ώ (C ++ κ°λ°μκ° μ’μνλ κ²½ν₯μ΄μλ)μ μ¬μ©μ λ°λΌ λ§μ΄κ·Έλ μ΄μ μ€μ μν©μ΄ κ±°μΉ μ΄ μ§ μ μμ΅λλ€. π λ€ννλ μ C # μ½λλ² μ΄μ€λ νμ λ€λ₯Έ μΈμ΄λ‘μ ν¬λ‘μ€ μ»΄νμΌμ νμ©νλ μ€νμΌλ‘ μ‘°μ λμμΌλ―λ‘ κ²°κ³Όλ μ½λ ꡬ쑰μμ μλΉν νμ©λ©λλ€. . μ€λ² ν€λλ₯Ό μ€μ΄κΈ° μν΄ λͺ¨λμ ꡬμ±νλ λ°©λ²μ μ’ λ μ μμ λ΄λ©΄λ©λλ€. π
μ΄ νλ¬κ·ΈμΈμ typescriptμ μ체 μ¦λΆ λΉλλ₯Ό λͺ μ μ μΌλ‘ μ¬μ©νμ§ μμ΅λλ€ (μμ λΉμ μ‘΄μ¬νμ§ μμ μ).
μ΄ νλ¬κ·ΈμΈμ΄ μ¬μ©μ μ§μ "μ¦λΆ"λΉλ μ λ΅μ κ°μ§κ³ μμ΅λκΉ? μκ³λ₯Ό μ¬μ©ν λ μμ μ 리 λΉλκ° μμ€ λ³κ²½λ³΄λ€ μ€λ 걸리λ μ΄μ λ₯Ό μ€λͺ ν μ μμ΅λλ€. typescript μ»΄νμΌμ λ€μ μμ μ μ΄λ©°μ΄ νλ¬κ·ΈμΈμ΄ μμ§ μ¦λΆ μ λ°μ΄νΈλ₯Ό μ¬μ©ν μ μλ€λ κ²μ μ κ°μ΄μ§λ§ μ ν μ€ν¬λ¦½νΈ μ»΄νμΌλ¬μ μμλλ μκ°μ μμ μ μ΄λΌκ³ μκ°ν©λλ€. κ·Έλ¬λ λ‘€μ μ μμλλ μκ°μ λ€μν©λλ€. μ΄κ²μ κΉ¨λν λΉλκ° κ°μ λͺ¨λλ‘ μ½λλ₯Ό λ³κ²½νλ κ²λ³΄λ€ λΉ λ₯΄λ€λ κ²μ μ€λͺ ν©λλ€.
@ rollup / plugin-typescriptλ₯Ό μλν΄ λ³Ό μ μμ΅λλ€ ...
ννΈλ₯Ό λ³΄λ΄ μ£Όμ μ κ°μ¬ν©λλ€. κ°μ λλμ§ νμΈν΄ λ³΄κ² μ΅λλ€.
λ λ€λ₯Έ μ΅μ μ λ‘€μ 체μΈμμ typescript μ»΄νμΌμ μννλ κ²μ λλ€.
μ²μμλ κ·Έλ° μ€μ μ΄ μμμ§λ§ κ°λ° μ€μ "κ°μ"λΉλλ₯Ό κ°λλ‘ μ λ° μ λ λ¨μ΄ λ¨ λ Έμ΅λλ€. λ 립μ μΌλ‘ "κ°μ"νλ λ κ°μ§ λκ΅¬λ‘ νμ΄ν λΌμΈμ μ°κ²°ν μ μλ€λ©΄ λ€μ ν λ² μλν΄ λ³΄κ² μ΅λλ€. π
μ λ°μ΄νΈ 1 : λ‘€μ μΌλ‘ μ°κ²°λ tscλ₯Ό νΈμΆνμ¬ μ 체 μ»΄νμΌ λ° ν μ€νΈ νκ²½μ μ€μ ν μμμμ΅λλ€. tsconfig κ²½λ‘λ₯Ό μ¬λ°λ₯΄κ² ν΄κ²°νκΈ° μν΄ λ΄ λ‘€μ νλ¬κ·ΈμΈμ λ§λ€μ΄μΌνμ§λ§ κ·Έ νμλ μ λλ‘ μλνμ΅λλ€.
ν΄λ¦° μ»΄νμΌ : 9 μ΄, κ°μ μ»΄νμΌ : 0.5-1 μ΄ λ° Karma + Rollupμ ν΅ν ν μ€νΈλ μ€ν μ€μ λλ€ (μ»΄νμΌμ κ° ν μ€νΈ μ€μνΈμ λν΄ λ²λ€μ μμ±νλ―λ‘ μκ°μ΄ μ‘°κΈ λ 걸립λλ€).
κ°μ₯ μ μ©ν λκΈ
@ezolenko λ¦κ² νμ ν΄
clean: true
λ£κ³ rtp2λ₯Ό0.20.1
μ κ·Έλ μ΄λνμ΅λλ€. κ²°κ³Όλ λ€μκ³Ό κ°μ΅λλ€.TS 3.3.3333
TS 3.3.4000
TS 3.4.1
TS 3.4.3
λνμ΄ μ΄ λ¬Έμ μ κ΄λ ¨λ κ²μΌλ‘ 보μΈλ€λ TSμ repoμνμ§λ§ λλμ΄
@types/styled-components
μ κ³ μ v4.1.4
κ° λ΄ κ²½μ°μλ μ μ©λμ§ μλλ‘ν©λλ€.λ λ§μ μ λ³΄κ° νμνλ©΄ μλ €μ£ΌμΈμ.
μ¬λ―Έλ₯Ό μν΄ μ΅μ
3.5
λΉλλ μλνμ΅λλ€.TS 3.5.0-dev. 20190413