官术网_书友最值得收藏!

Creating and initializing an example project

Use the command line, your favorite IDE, or your file browser to create a directory somewhere on your machine called MLinJSBook, with a subdirectory called Ch1-Ex1.

Navigate your command line to the Ch1-Ex1 folder, and run the command yarn init, which like npm init will create a package.json file and prompt you for basic information. Respond to the prompts, answering appropriately. You will not be publishing this package so the answers aren't too important, however, when prompted for the application's entry point, type in dist/index.js.

Next, we need to install a few build tools that we'll use for the majority of our example projects:

  • babel-core: The Babel transpiler core
  • babel-preset-env: The Babel parser preset that parses ES6, ES7, and ES8 code
  • browserify: A JavaScript bundler which can compile multiple files into a single file
  • babelify: The Babel plugin for Browserify

Install these as development environment requirements by issuing the following command:

yarn add -D babel-cli browserify babelify babel-preset-env
主站蜘蛛池模板: 龙里县| 湄潭县| 烟台市| 绿春县| 栖霞市| 桦川县| 三江| 榆树市| 句容市| 格尔木市| 江达县| 宜宾县| 鄂伦春自治旗| 长泰县| 原平市| 内乡县| 绥芬河市| 博湖县| 五莲县| 娄底市| 方山县| 启东市| 余庆县| 乌鲁木齐市| 卢氏县| 元阳县| 额尔古纳市| 巴中市| 贵德县| 逊克县| 通州区| 闵行区| 锡林郭勒盟| 农安县| 日照市| 巴彦县| 永济市| 门头沟区| 麻栗坡县| 周至县| 云安县|