diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000..636414ca --- /dev/null +++ b/deploy.sh @@ -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 diff --git a/webpack.mix.js b/webpack.mix.js index 8c4d3a53..6746b7af 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -13,13 +13,13 @@ mix.disableNotifications() .copyDirectory('assets/images', 'source/build/images') .copyDirectory('node_modules/font-awesome/fonts', 'source/build/fonts') .tailwind() - // .purgeCss({ - // globs: [ - // path.join(__dirname, 'output_*/**/*.html'), - // ], - // whitelistPatterns: [/language/, /hljs/], - // whitelistPatternsChildren: [/^markdown$/] - // }) + .purgeCss({ + globs: [ + path.join(__dirname, 'output_*/**/*.html'), + ], + whitelistPatterns: [/language/, /hljs/], + whitelistPatternsChildren: [/^markdown$/] + }) .options({ processCssUrls: false });