├── .gitignore ├── README.md ├── package-lock.json ├── package.json └── src ├── css └── styles.css ├── images └── magic.gif ├── index.html └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | lerna-debug.log* 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | *.lcov 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules/ 44 | jspm_packages/ 45 | 46 | # TypeScript v1 declaration files 47 | typings/ 48 | 49 | # TypeScript cache 50 | *.tsbuildinfo 51 | 52 | # Optional npm cache directory 53 | .npm 54 | 55 | # Optional eslint cache 56 | .eslintcache 57 | 58 | # Microbundle cache 59 | .rpt2_cache/ 60 | .rts2_cache_cjs/ 61 | .rts2_cache_es/ 62 | .rts2_cache_umd/ 63 | 64 | # Optional REPL history 65 | .node_repl_history 66 | 67 | # Output of 'npm pack' 68 | *.tgz 69 | 70 | # Yarn Integrity file 71 | .yarn-integrity 72 | 73 | # dotenv environment variables file 74 | .env 75 | .env.test 76 | 77 | # parcel-bundler cache (https://parceljs.org/) 78 | .cache 79 | 80 | # Next.js build output 81 | .next 82 | 83 | # Nuxt.js build / generate output 84 | .nuxt 85 | dist 86 | 87 | # Gatsby files 88 | .cache/ 89 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 90 | # https://nextjs.org/blog/next-9-1#public-directory-support 91 | # public 92 | 93 | # vuepress build output 94 | .vuepress/dist 95 | 96 | # Serverless directories 97 | .serverless/ 98 | 99 | # FuseBox cache 100 | .fusebox/ 101 | 102 | # DynamoDB Local files 103 | .dynamodb/ 104 | 105 | # TernJS port file 106 | .tern-port 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # parcel-deploy-tutorial 2 | 3 | ## Мастерская: деплой билда от Parcel на GitHub Pages 4 | 5 | 1. Редактируем скрипт build и добавляем `--public-url /имя_репозитория/` 6 | 2. Редактрируем в package.json поле `"homepage": "https://ваше_имя.github.io/имя_репозитория"` 7 | 3. Устанавливаем пакет [`npm install gh-pages`](https://www.npmjs.com/package/gh-pages) 8 | 4. Добавляем npm-скрипты 9 | 1. `"deploy": "gh-pages -d dist"` 10 | 2. `"predeploy": "npm run build"` 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parcel-deploy", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "parcel src/index.html", 8 | "build": "parcel build src/index.html --public-url /parcel-deploy-tutorial/", 9 | "deploy": "gh-pages -d dist", 10 | "predeploy": "npm run build" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/luxplanjay/parcel-deploy-tutorial.git" 15 | }, 16 | "keywords": [], 17 | "author": "Alexander Repeta ", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/luxplanjay/parcel-deploy-tutorial/issues" 21 | }, 22 | "homepage": "https://luxplanjay.github.io/parcel-deploy-tutorial", 23 | "devDependencies": { 24 | "parcel-bundler": "^1.12.4", 25 | "parcel-plugin-nuke-dist": "^1.0.1" 26 | }, 27 | "dependencies": { 28 | "gh-pages": "^3.1.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, 4 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; 5 | } 6 | 7 | h1 { 8 | font-size: 48px; 9 | color: #2a2a2a; 10 | } 11 | 12 | .container { 13 | text-align: center; 14 | } 15 | -------------------------------------------------------------------------------- /src/images/magic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luxplanjay/parcel-deploy-tutorial/913534e69d6976b8a5d5ccde5711461d11193333/src/images/magic.gif -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Мастерская: деплой билда от Parcel на GitHub Pages 7 | 8 | 9 |
10 |

Мастерская: деплой билда от Parcel на GitHub Pages

11 | 12 | Магия и волшебство 13 |
14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import "./css/styles.css"; 2 | 3 | console.log("Мастерская: деплой билда от Parcel на GitHub Pages"); 4 | --------------------------------------------------------------------------------