Re-enable PurgeCSS, add deploy.sh

This commit is contained in:
Oliver Davies 2018-07-14 00:40:32 +01:00
parent 01878fdac6
commit d42069eb7e
2 changed files with 28 additions and 7 deletions

21
deploy.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
# Build script for deploying on Netlify.
#
# "composer install" and "yarn install" are run automatically, so there's no
# need to add them here.
# Run the tests to ensure that nothing is broken.
vendor/bin/phpunit
# Generate the site once with no assets to that PurgeCSS has something to look
# at.
vendor/bin/sculpin generate -e prod
# Generate the front-end assets.
yarn build
# Re-generate the again with the assets in the correct location.
vendor/bin/sculpin generate -e prod

View file

@ -13,13 +13,13 @@ mix.disableNotifications()
.copyDirectory('assets/images', 'source/build/images') .copyDirectory('assets/images', 'source/build/images')
.copyDirectory('node_modules/font-awesome/fonts', 'source/build/fonts') .copyDirectory('node_modules/font-awesome/fonts', 'source/build/fonts')
.tailwind() .tailwind()
// .purgeCss({ .purgeCss({
// globs: [ globs: [
// path.join(__dirname, 'output_*/**/*.html'), path.join(__dirname, 'output_*/**/*.html'),
// ], ],
// whitelistPatterns: [/language/, /hljs/], whitelistPatterns: [/language/, /hljs/],
// whitelistPatternsChildren: [/^markdown$/] whitelistPatternsChildren: [/^markdown$/]
// }) })
.options({ .options({
processCssUrls: false processCssUrls: false
}); });