Proposal to remove generated code from being versioned (#89)

* Ignore changes made to index.html by creating a sample file

* Ignore generated files

* Use the correct order for the dev deps

* Copy "index.html" when necessary

Since we won't want to version generated code.

* fixup! Ignore generated files
This commit is contained in:
thomas
2018-06-19 18:06:59 +02:00
committed by Tom MacWright
parent bd0115f70a
commit 43f7f54a78
3 changed files with 8 additions and 2 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
lib/
bundle.js
index.html

View File

@ -4,12 +4,14 @@
"description": "an api documentation website", "description": "an api documentation website",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"gen-index": "cpy --no-overwrite index.html.sample --rename=index.html .",
"postinstall": "npm run gen-index",
"start": "budo src/index.js --serve=bundle.js --live", "start": "budo src/index.js --serve=bundle.js --live",
"release": "standard-version", "release": "standard-version",
"test": "npm run test-unit && eslint src && npm run prerender -- /dev/null && rm -rf lib", "test": "npm run test-unit && eslint src && npm run prerender -- /dev/null && rm -rf lib",
"test-unit": "mocha --compilers js:babel-register test", "test-unit": "mocha --compilers js:babel-register test",
"prerender": "babel src --out-dir lib && node lib/render.js", "prerender": "babel src --out-dir lib && node lib/render.js",
"build": "cross-env NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html" "build": "npm run gen-index && cross-env NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html"
}, },
"browserify": { "browserify": {
"transform": [ "transform": [
@ -56,11 +58,12 @@
"devDependencies": { "devDependencies": {
"babel-register": "^6.3.13", "babel-register": "^6.3.13",
"budo": "^11.0.0", "budo": "^11.0.0",
"cpy-cli": "^2.0.0",
"cross-env": "^5.1.6", "cross-env": "^5.1.6",
"cz-conventional-changelog": "2.1.0", "cz-conventional-changelog": "2.1.0",
"standard-version": "^4.4.0",
"expect": "^23.0.1", "expect": "^23.0.1",
"mocha": "^5.0.0", "mocha": "^5.0.0",
"standard-version": "^4.4.0",
"to-vfile": "^4.0.0", "to-vfile": "^4.0.0",
"uglify-js": "^3.0.27" "uglify-js": "^3.0.27"
}, },