Giter Site home page Giter Site logo

enum-vs-const-assertion's Introduction

TypeScript Enum vs Const Assertion

개요

타입스크립트의 enum과 const assertion (a.k.a. as const) 사이의 차이를 알아보고 싶어서 만든 실험실입니다. 열거형은 tree-shaking이 되지 않는다는 이야기가 있어서 정말인지 궁금했어요.

실행 방법

사실 실행 결과물은 이미 레포지토리에 들어 있습니다. 윈도우 컴퓨터에서 실행한 거라 혹시 맥에서 돌아가지 않는다면 미리 사과(apple)의 말씀 전합니다.

js-to-bundled-js는 타입스크립트 컴파일러를 사용해서 자바스크립트로 트랜스파일한 코드에 번들러를 먹인 것이고, ts-to-bundled-js는 각 번들러에서 제공하는 본인의 기능을 사용해 타입스크립트에서 자바스크립트로 한번에 바꾼 것입니다(물론 얘네도 내부에서는 타입스크립트 컴파일러를 쓸 수도 있음). webpack-babel은 타입스크립트에서 바로 자바스크립트로 옮긴 코드만 있습니다.

tsc (transpile only)

npm run ts-to-js

rollup

npm run do:rollup

esbuild

npm run do:esbuild

webpack + babel

npm run do:webpack-babel

귀찮은데 한번에 돌리죠?

npm run all

enum-vs-const-assertion's People

Contributors

wainaat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.