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

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
主站蜘蛛池模板: 山阴县| 丁青县| 疏勒县| 辉南县| 莱芜市| 安阳市| 株洲市| 东台市| 焉耆| 汉中市| 天祝| 十堰市| 依安县| 德格县| 岱山县| 通渭县| 抚顺市| 镇安县| 莲花县| 读书| 通城县| 凌海市| 德格县| 弥渡县| 科技| 宜兴市| 信宜市| 和平区| 娱乐| 松原市| 涟水县| 瑞昌市| 汉川市| 吉水县| 华容县| 昂仁县| 临洮县| 扎囊县| 德化县| 如皋市| 广平县|