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

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
主站蜘蛛池模板: 句容市| 原平市| 和平区| 望城县| 兴文县| 山阳县| 桐庐县| 湖州市| 昌乐县| 蒙阴县| 阜阳市| 松滋市| 新安县| 莱州市| 永修县| 泰和县| 寿阳县| 化德县| 华阴市| 清丰县| 广东省| 定襄县| 隆安县| 康保县| 茂名市| 克什克腾旗| 丰台区| 荥经县| 遂昌县| 永福县| 康乐县| 沾化县| 贡嘎县| 黑山县| 宜昌市| 沽源县| 铁岭县| 濮阳县| 自贡市| 沿河| 高碑店市|