Last active
October 3, 2021 10:15
-
-
Save MaksymGrom/5c0259ddf960d48ff9ab5528aa3cf9ad to your computer and use it in GitHub Desktop.
Настройка проекта с babel для изучения JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) Add files to your project | |
| package.json | |
| ``` | |
| { | |
| "name": "jsdocks", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "start": "parcel index.html --open", | |
| "build": "parcel build index.html" | |
| }, | |
| "dependencies": { | |
| "parcel-bundler": "^1.12.5" | |
| }, | |
| "devDependencies": { | |
| "@babel/core": "^7.15.5" | |
| }, | |
| "resolutions": { | |
| "@babel/preset-env": "7.13.8" | |
| } | |
| } | |
| ``` | |
| index.html | |
| ``` | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <script src="src/index.js"></script> | |
| </body> | |
| </html> | |
| ``` | |
| src\index.js | |
| ``` | |
| // write your js here | |
| ``` | |
| 2) run: npm install | |
| 3) run: npm run start | |
| 4) have fun! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment