0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Swapped grunt-cssnano for grunt-postcss+cssnano

- The grunt-cssnano plugin is old and no longer maintained
- It uses insecure dependencies that don't really impact us, but we want to get rid of warnings
- Swapping for grunt-postcss+cssnano is a more up-to-date way of sorting this out
This commit is contained in:
Hannah Wolfe 2020-04-01 13:01:03 +01:00
parent 5ef8e0241f
commit a4175ff218
3 changed files with 724 additions and 463 deletions

View file

@ -38,6 +38,7 @@ const configureGrunt = function (grunt) {
// //
// Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all // Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks); require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks);
grunt.loadNpmTasks('@lodder/grunt-postcss');
var cfg = { var cfg = {
// #### Common paths used by tasks // #### Common paths used by tasks
@ -276,10 +277,12 @@ const configureGrunt = function (grunt) {
} }
}, },
cssnano: { postcss: {
prod: { prod: {
options: { options: {
sourcemap: false processors: [
require('cssnano')() // minify the result
]
}, },
files: { files: {
'core/server/public/ghost.min.css': 'core/server/public/ghost.css' 'core/server/public/ghost.min.css': 'core/server/public/ghost.css'
@ -542,7 +545,7 @@ const configureGrunt = function (grunt) {
// //
// It is otherwise the same as running `grunt`, but is only used when running Ghost in the `production` env. // It is otherwise the same as running `grunt`, but is only used when running Ghost in the `production` env.
grunt.registerTask('prod', 'Build JS & templates for production', grunt.registerTask('prod', 'Build JS & templates for production',
['subgrunt:prod', 'uglify:prod', 'cssnano:prod', 'master-warn']); ['subgrunt:prod', 'uglify:prod', 'postcss:prod', 'master-warn']);
// ### Live reload // ### Live reload
// `grunt dev` - build assets on the fly whilst developing // `grunt dev` - build assets on the fly whilst developing

View file

@ -134,6 +134,8 @@
"sqlite3": "4.1.1" "sqlite3": "4.1.1"
}, },
"devDependencies": { "devDependencies": {
"@lodder/grunt-postcss": "^2.0.1",
"cssnano": "^4.1.10",
"eslint": "6.8.0", "eslint": "6.8.0",
"eslint-plugin-ghost": "1.0.1", "eslint-plugin-ghost": "1.0.1",
"grunt": "1.1.0", "grunt": "1.1.0",
@ -145,7 +147,6 @@
"grunt-contrib-symlink": "1.0.0", "grunt-contrib-symlink": "1.0.0",
"grunt-contrib-uglify": "4.0.1", "grunt-contrib-uglify": "4.0.1",
"grunt-contrib-watch": "1.1.0", "grunt-contrib-watch": "1.1.0",
"grunt-cssnano": "3.0.0",
"grunt-express-server": "0.5.4", "grunt-express-server": "0.5.4",
"grunt-mocha-cli": "6.0.0", "grunt-mocha-cli": "6.0.0",
"grunt-shell": "3.0.1", "grunt-shell": "3.0.1",

1175
yarn.lock

File diff suppressed because it is too large Load diff