]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Move node-sass to npm script and drop Ruby Sass.
authorBardi Harborow <bardi@bardiharborow.com>
Tue, 3 Jan 2017 00:46:57 +0000 (11:46 +1100)
committerBardi Harborow <bardi@bardiharborow.com>
Wed, 4 Jan 2017 01:28:06 +0000 (12:28 +1100)
Gruntfile.js
docs/getting-started/build-tools.md
grunt/bs-sass-compile/libsass.js [deleted file]
grunt/bs-sass-compile/sass.js [deleted file]
package.json

index c7b6caca199967d407d70fc7454e5a4e2acaa394..7d16ff4320f7b0d57c4de74bc043fbb203419ecc 100644 (file)
@@ -226,6 +226,12 @@ module.exports = function (grunt) {
       htmlhint: {
         command: 'npm run htmlhint'
       },
+      sass: {
+        command: 'npm run sass'
+      },
+      'sass-docs': {
+        command: 'npm run sass-docs'
+      },
       'scss-lint': {
         command: 'npm run scss-lint'
       },
@@ -278,9 +284,7 @@ module.exports = function (grunt) {
 
 
   // These plugins provide necessary tasks.
-  require('load-grunt-tasks')(grunt, { scope: 'devDependencies',
-    // Exclude Sass compilers. We choose the one to load later on.
-    pattern: ['grunt-*', '!grunt-sass', '!grunt-contrib-sass'] })
+  require('load-grunt-tasks')(grunt)
   require('time-grunt')(grunt)
 
   // Docs HTML validation task
@@ -324,15 +328,10 @@ module.exports = function (grunt) {
   // JS distribution task.
   grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'exec:uglify'])
 
-  grunt.registerTask('test-scss', ['exec:scss-lint']);
+  grunt.registerTask('test-scss', ['exec:scss-lint'])
 
   // CSS distribution task.
-  // Supported Compilers: sass (Ruby) and libsass.
-  (function (sassCompilerName) {
-    require('./grunt/bs-sass-compile/' + sassCompilerName + '.js')(grunt)
-  }(process.env.TWBS_SASS || 'libsass'))
-  // grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs']);
-  grunt.registerTask('sass-compile', ['sass:core', 'sass:extras', 'sass:docs'])
+  grunt.registerTask('sass-compile', ['exec:sass', 'exec:sass-docs'])
 
   grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'exec:clean-css-docs'])
 
index a48304ebcc4c27b60af61988cbed5e84233ddc96..0d441d216d4e5a8c76f9b59ff51e458567468647 100644 (file)
@@ -39,15 +39,6 @@ Our Gruntfile includes the following commands and tasks:
 | `grunt docs` | Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via `jekyll serve`. |
 | `grunt watch` | This is a convenience method for watching just Sass files and automatically building them whenever you save. |
 
-## Switching Sass compilers
-
-Bootstrap will be compiled with [libsass][libsass] by default, but you can opt into traditional Ruby Sass by setting the `TWBS_SASS` environment variable. Two options are supported:
-
-* `libsass` (default) to use [libsass][libsass] via [grunt-sass][grunt-sass].
-* `sass` to use [Ruby Sass][ruby-sass] via [grunt-contrib-sass][grunt-contrib-sass].
-
-For example, run `TWBS_SASS=sass grunt` to test and build Bootstrap with Ruby Sass.
-
 ## Autoprefixer
 
 Bootstrap uses [Autoprefixer][autoprefixer] (included in our Gruntfile and build process) to automatically add vendor prefixes to some CSS properties at build time. Doing so saves us time and code by allowing us to write key parts of our CSS a single time while eliminating the need for vendor mixins like those found in v3.
@@ -68,8 +59,4 @@ Learn more about using Jekyll by reading its [documentation](https://jekyllrb.co
 
 Should you encounter problems with installing dependencies or running Grunt commands, uninstall all previous dependency versions (global and local). Then, rerun `npm install`.
 
-[ruby-sass]: https://github.com/sass/sass
-[grunt-contrib-sass]: https://github.com/gruntjs/grunt-contrib-sass
-[libsass]: https://github.com/sass/libsass
-[grunt-sass]: https://github.com/sindresorhus/grunt-sass
 [autoprefixer]: https://github.com/postcss/autoprefixer
diff --git a/grunt/bs-sass-compile/libsass.js b/grunt/bs-sass-compile/libsass.js
deleted file mode 100644 (file)
index 06b9dcc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Compile Bootstrap with [libsass][1] using [grunt-sass][2]
-// [1]: https://github.com/sass/libsass
-// [2]: https://github.com/sindresorhus/grunt-sass
-module.exports = function configureLibsass(grunt) {
-  grunt.config.merge({
-    sass: {
-      options: {
-        includePaths: ['scss'],
-        precision: 6,
-        sourceComments: false,
-        sourceMap: true,
-        outputStyle: 'expanded'
-      },
-      core: {
-        files: {
-          'dist/css/<%= pkg.name %>.css': 'scss/<%= pkg.name %>.scss'
-        }
-      },
-      extras: {
-        files: {
-          'dist/css/<%= pkg.name %>-grid.css': 'scss/<%= pkg.name %>-grid.scss',
-          'dist/css/<%= pkg.name %>-reboot.css': 'scss/<%= pkg.name %>-reboot.scss'
-        }
-      },
-      docs: {
-        files: {
-          'docs/assets/css/docs.min.css': 'docs/assets/scss/docs.scss'
-        }
-      }
-    }
-  })
-  grunt.loadNpmTasks('grunt-sass')
-}
diff --git a/grunt/bs-sass-compile/sass.js b/grunt/bs-sass-compile/sass.js
deleted file mode 100644 (file)
index dadd93d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Compile Bootstrap with [Ruby Sass][1] using [grunt-contrib-sass][2]
-// [1]: https://github.com/sass/sass
-// [2]: https://github.com/gruntjs/grunt-contrib-sass
-module.exports = function configureRubySass(grunt) {
-  var options = {
-    loadPath: ['scss'],
-    precision: 6,
-    sourcemap: 'auto',
-    style: 'expanded',
-    trace: true,
-    bundleExec: true
-  }
-  grunt.config.merge({
-    sass: {
-      core: {
-        options: options,
-        files: {
-          'dist/css/<%= pkg.name %>.css': 'scss/<%= pkg.name %>.scss'
-        }
-      },
-      extras: {
-        options: options,
-        files: {
-          'dist/css/<%= pkg.name %>-grid.css': 'scss/<%= pkg.name %>-grid.scss',
-          'dist/css/<%= pkg.name %>-reboot.css': 'scss/<%= pkg.name %>-reboot.scss'
-        }
-      },
-      docs: {
-        options: options,
-        files: {
-          'docs/assets/css/docs.min.css': 'docs/assets/scss/docs.scss'
-        }
-      }
-    }
-  })
-  grunt.loadNpmTasks('grunt-contrib-sass')
-}
index bace757224d87205a7c40a86bf0fc32945eaee32..ee7c2a26dc4623f02377322f11b08d6ce324b4d8 100644 (file)
@@ -24,6 +24,8 @@
     "htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
     "postcss": "postcss --config grunt/postcss.js --replace dist/css/*.css",
     "postcss-docs": "postcss --config grunt/postcss.js --no-map --replace docs/assets/css/docs.min.css && postcss --config grunt/postcss.js --no-map --replace docs/examples/**/*.css",
+    "sass": "node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css",
+    "sass-docs": "node-sass --output-style expanded --source-map true --precision 6 docs/assets/scss/docs.scss docs/assets/css/docs.min.css",
     "scss-lint": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude scss/_normalize.scss scss/*.scss",
     "scss-lint-docs": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude docs/assets/scss/docs.scss docs/assets/scss/*.scss",
     "uglify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
     "grunt-contrib-connect": "^1.0.2",
     "grunt-contrib-copy": "^1.0.0",
     "grunt-contrib-qunit": "^1.2.0",
-    "grunt-contrib-sass": "^1.0.0",
     "grunt-contrib-watch": "^1.0.0",
     "grunt-exec": "^1.0.1",
     "grunt-html": "^8.0.2",
     "grunt-jekyll": "^0.4.4",
-    "grunt-sass": "2.0.0",
     "grunt-saucelabs": "^9.0.0",
     "grunt-stamp": "^0.3.0",
     "htmlhint": "^0.9.13",
     "is-travis": "^1.0.0",
     "load-grunt-tasks": "^3.5.2",
+    "node-sass": "^4.1.1",
     "postcss-cli": "^2.6.0",
     "postcss-flexbugs-fixes": "^2.0.0",
     "shelljs": "^0.7.4",