diff --git a/Gruntfile.js b/Gruntfile.js index b1de9b01..5554f3ab 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,7 @@ const fs = require('fs'); const glob = require('glob'); const ejs = require('ejs'); +const sass = require('sass'); module.exports = function(grunt) { var pkg = require("./package.json"); @@ -8,7 +9,6 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: pkg, - sass: require('./grunt/config/sass.js'), cssUrlEmbed: require('./grunt/config/cssUrlEmbed.js') }); @@ -40,7 +40,21 @@ module.exports = function(grunt) { grunt.loadTasks('grunt/tasks'); - grunt.registerTask('default', ['sass:dist', "cssUrlEmbed"]); + grunt.registerTask('sass', + 'Compile sass to css', + function() { + try { + const output = sass.compile('src/html/jasmine.scss'); + fs.writeFileSync('lib/jasmine-core/jasmine.css', output.css, + {encoding: 'utf8'}); + } catch (e) { + console.error(e); + throw e; + } + } + ); + + grunt.registerTask('default', ['sass', "cssUrlEmbed"]); grunt.registerTask('concat', 'Concatenate files', @@ -149,7 +163,7 @@ module.exports = function(grunt) { grunt.registerTask('buildDistribution', 'Builds and lints jasmine.js, jasmine-html.js, jasmine.css', [ - 'sass:dist', + 'sass', "cssUrlEmbed", 'concat' ] diff --git a/grunt/config/sass.js b/grunt/config/sass.js deleted file mode 100644 index 3ce0ef61..00000000 --- a/grunt/config/sass.js +++ /dev/null @@ -1,13 +0,0 @@ -const sass = require('sass'); - -module.exports = { - options: { - implementation: sass, - sourceComments: false - }, - dist: { - files: { - "lib/jasmine-core/jasmine.css": "src/html/jasmine.scss" - } - } -}; diff --git a/package.json b/package.json index b2f0ef41..72bb4db5 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "globals": "^16.0.0", "grunt": "^1.0.4", "grunt-cli": "^1.3.2", - "grunt-sass": "^4.0.0", "jasmine": "^5.0.0", "jasmine-browser-runner": "github:jasmine/jasmine-browser-runner", "jsdom": "^26.0.0",