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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | |
<!-- | |
Notice the use of %PUBLIC_URL% in the tags above. | |
It will be replaced with the URL of the `public` folder during the build. | |
Only files inside the `public` folder can be referenced from the HTML. |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
ReactDOM.render(<App />, document.getElementById('root')); | |
if (window.navigator && navigator.serviceWorker) { | |
navigator.serviceWorker.getRegistrations() | |
.then(function (registrations) { | |
const promise = []; |
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
/** | |
* Copyright 2016 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
{ | |
"name": "intro", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"react": "^16.2.0", | |
"react-dom": "^16.2.0", | |
"react-router-dom": "^4.2.2", | |
"react-scripts": "1.0.17", | |
"sw-precache": "^5.2.1" |
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
module.exports = { | |
stripPrefix: 'build/', | |
staticFileGlobs: [ | |
'build/*.html', | |
'build/manifest.json', | |
'build/static/**/!(*map*)' | |
], | |
dontCacheBustUrlsMatching: /\.\w{8}\./, | |
swFilePath: 'build/service-worker.js' | |
}; |
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
language: node_js | |
node_js: | |
- "stable" | |
cache: | |
directories: | |
- node_modules | |
script: | |
- npm test | |
- npm run build |
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
stages: | |
- build | |
- deploy | |
build prod: | |
image: node:10.15.0-stretch | |
stage: build | |
only: | |
- tags | |
script: |
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
// expand using spread operator | |
let arr = ['a','b']; | |
let arr2 = [...arr,'c','d']; | |
console.log(arr2); // [ 'a', 'b', 'c', 'd' ] |
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
let arr = ['a','b']; | |
let arr2 = [arr,'c','d']; | |
console.log(arr2); // [ [ 'a', 'b' ], 'c', 'd' ] |
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
// spread operator doing the concat job | |
let arr = [1,2,3]; | |
let arr2 = [4,5]; | |
arr = [...arr,...arr2]; | |
console.log(arr); // [ 1, 2, 3, 4, 5 ] |