jon
jon

Reputation: 6241

What does the JS "//= require bootstrap/" syntax mean? (Bootstrap 3 Sass)

Version:

Bootstrap Sass v3.1.1.

File:

Inside this file:

assets/javascripts/bootstrap.js 

Confusing Syntax:

There are a bunch of lines that look like so:

//= require bootstrap/affix
//= require bootstrap/alert
//= require bootstrap/button
...

I am unfamiliar with this syntax. I simply want to generate a minified version of all the bootstrap JS files.

What does this syntax mean? And, how is it used?

For context, my goal is simply to use Bootstrap Sass in a way that makes upgrading to the latest future versions of BS as straight forward as possible.

Upvotes: 1

Views: 190

Answers (1)

jon
jon

Reputation: 6241

This is sprockets syntax. It compiles the JS into a single file Sprockets.

Sprockets is a Ruby library for compiling and serving web assets. It features declarative dependency management for JavaScript and CSS assets, as well as a powerful preprocessor pipeline that allows you to write assets in languages like CoffeeScript, Sass and SCSS

Sprockets' repo: https://github.com/sstephenson/sprockets Sprockets in the Bootstrap Sass readme: https://github.com/twbs/bootstrap-sass#javascript

information via @stevuu, found in comments on question above.

Upvotes: 2

Related Questions