목록weekly (10)
신나는 개발...
변환은 플러그인의 코드의 변화를 어떻게 수행할지 바벨에게 지시하는 작은 자바스크립트 프로그램의 형식으로 나타난다. 심지어 원하는 변화를 적용하는 플러그인을 작성할 수 있다. ES2015+문법을 ES5로 변환할려면 공식플러그인인 @babel/plugin-transform-arrow-functions을 사용하면 된다. npm install --save-dev @babel/plugin-transform-arrow-functions ./node_modules/.bin/babel src --out-dir lib --plugins=@babel/plugin-transform-arrow-functions 이게 arrow함수는 ES5에 호환되는 함수 형식으로 바뀔거다. const fn = () => 1; // conve..
Basic usage with CLI 너가 필요하게 될 모든 바벨의 모듈은 @babel의 스코르(@babel/뭐시기를 말하는 듯 )로 npm 패키지로 발행되었다. 이 모듈은 각각의 특정 사용 케이스에 의해 설계된 다양한 툴을 염두하여 디자인되었다. Core Library 바벨의 코어기능은 @babel/core 모듈에 있다. npm install --save-dev @babel/core 자바스크립트 파일 내에서 요로케 바로 호출할 수 있다. const babel = require("@babel/core"); babel.transform("code", optionsObject); 그리고 아마 너는 인터페이스로서 @babel/core을 제공하고 개발프롤세스를 통합시키는 다른 툴을 설치하기를 원하게 될거야. 그..
https://babeljs.io/docs/en/usage Babel · The compiler for next generation JavaScript The compiler for next generation JavaScript babeljs.io 아래의 command로 babel package를 설치 : npm install --save-dev @babel/core @babel/cli @babel/preset-env npm install --save @babel/polyfill babal.config.json 의 이름으로 config파일을 생성 (프로젝트 root에 생성) { "presets": [ [ "@babel/env", { "targets": { "edge": "17", "firefox": "..
https://lodash.com/ Lodash _.defaults({ 'a': 1 }, { 'a': 3, 'b': 2 });_.partition([1, 2, 3, 4], n => n % 2);DownloadLodash is released under the MIT license & supports modern environments. Review the build differences & pick one that’s right for you.InstallationIn a browser: Using n lodash.com Why Lodash? Lodash는 array, number, objects, strings 등을ㄹ 다룰 때 번거로움을 줄여 자바스크립트를 쉽게해준다. Lodash 모듈 mthod는 이..