Use purgecss on output build

This commit is contained in:
Thog 2020-02-09 19:32:31 +01:00
parent 3c84f45038
commit 698bb39dd1
3 changed files with 11 additions and 4 deletions

View file

@ -20,12 +20,15 @@ jobs:
- name: "Install NPM dependencies"
run: npm install
- name: "Install gridsome CLI"
run: "npm install --global @gridsome/cli"
- name: "Install CLI tools"
run: "npm install --global @gridsome/cli purgecss"
- name: "Build"
run: npm run build
- name: "PurgeCSS pass"
run: purgecss --config purgecss.config.js --output dist/assets/css/
- name: "Deploy"
uses: peaceiris/actions-gh-pages@v3
with:

View file

@ -9,12 +9,12 @@
"explore": "gridsome explore"
},
"dependencies": {
"@gridsome/plugin-sitemap": "^0.2.3",
"gridsome": "^0.7.0",
"gridsome-plugin-robots-txt": "^1.0.2",
"vuetify": "^1.0.0"
},
"devDependencies": {
"@gridsome/plugin-sitemap": "^0.2.3",
"gridsome-plugin-robots-txt": "^1.0.2",
"webpack-node-externals": "^1.7.2"
}
}

4
purgecss.config.js Normal file
View file

@ -0,0 +1,4 @@
module.exports = {
content: ['dist/**/*.html', 'dist/assets/js/*.js'],
css: ['dist/assets/css/*.css']
}