Ghost/ghost/admin/Gruntfile.js
Daniel Lockyer a398a0e57d
Cleaned up subgrunt usage between Ghost and Admin
refs https://github.com/TryGhost/Toolbox/issues/365

- some of this was barely used anyway, but now Admin is a package in the
  monorepo, we don't need to be installing dependencies twice
2022-08-03 17:05:57 +02:00

59 lines
1.7 KiB
JavaScript

/* eslint-env node */
/* eslint-disable object-shorthand */
'use strict';
module.exports = function (grunt) {
// 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);
grunt.initConfig({
clean: {
built: {
src: ['dist/**']
},
dependencies: {
src: ['node_modules/**']
},
tmp: {
src: ['tmp/**']
}
},
watch: {
csscomb: {
files: ['app/styles/**/*.css'],
tasks: ['shell:csscombfix']
}
},
shell: {
ember: {
command: function (mode) {
let liveReloadBaseUrl = grunt.option('live-reload-base-url') || '/ghost/';
switch (mode) {
case 'prod':
return 'npm run build -- --environment=production --silent';
case 'dev':
return 'npm run build';
case 'watch':
return `npm run start -- --live-reload-base-url=${liveReloadBaseUrl} --live-reload-port=4201`;
}
}
},
csscombfix: {
command: 'csscomb -c app/styles/csscomb.json -v app/styles'
},
csscomblint: {
command: 'csscomb -c app/styles/csscomb.json -lv app/styles'
},
options: {
preferLocal: true
}
}
});
};