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

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
主站蜘蛛池模板: 循化| 呼图壁县| 许昌市| 紫云| 芦溪县| 清水河县| 温泉县| 万宁市| 南江县| 阿勒泰市| 崇义县| 榆树市| 绥滨县| 敦煌市| 通化市| 神农架林区| 五峰| 隆化县| 北流市| 岚皋县| 满城县| 宜川县| 盐津县| 罗山县| 翁源县| 施甸县| 汉源县| 宝鸡市| 班玛县| 泰安市| 莲花县| 镶黄旗| 夏津县| 十堰市| 都安| 阳江市| 阿克陶县| 邳州市| 隆德县| 新丰县| 铜陵市|