diff --git a/.travis.yml b/.travis.yml index dd8a67d..10a2c6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,15 @@ install: npm i script: - npm test - npm run build -- npm run clean + + # Remove unwanted files +- find . -maxdepth 1 -type f -not -name 'LICENSE' -not -name 'index.html' -not -name 'README.md' -delete && + rm -fr node_modules src dist/vanity.js + + #Cache busting +- COMMIT=$(git log --format='%h' -n 1) && + sed -i "s/index.js/index.$COMMIT.js/g" index.html && + mv dist/index.js dist/index.$COMMIT.js deploy: provider: pages diff --git a/package.json b/package.json index 9d4a9a0..a20419d 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,7 @@ "scripts": { "test": "node ./node_modules/xo/cli.js", "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", - "build": "cross-env NODE_ENV=production webpack --progress --hide-modules", - "clean": "find . -maxdepth 1 -type f -not -name 'LICENSE' -not -name 'index.html' -not -name 'README.md' -delete && rm -fr node_modules src dist/vanity.js" + "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" }, "xo": { "rules": {