Move script to build commit

This commit is contained in:
Nicholas Zuber 2020-01-20 16:59:47 -05:00
parent 3c1295eb01
commit 59750111db
2 changed files with 6 additions and 3 deletions

View File

@ -19,7 +19,10 @@ const paths = require('./paths');
const getClientEnvironment = require('./env');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const gitHash = readFileSync('./git-hash.txt').toString().trim();
let gitHash = '';
try {
gitHash = readFileSync('./git-hash.txt').toString().trim();
} catch (e) {}
// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.

View File

@ -76,10 +76,10 @@
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js && cp build/index.html build/200.html",
"build": "npm run before-build && node scripts/build.js && cp build/index.html build/200.html",
"now-build": "npm run build",
"test": "node scripts/test.js",
"postcommit": "git rev-parse --short HEAD > git-hash.txt",
"before-build": "git rev-parse --short HEAD > git-hash.txt",
"deploy": "now --prod"
},
"eslintConfig": {