Skip to content

Instantly share code, notes, and snippets.

@ponko2
Created October 29, 2015 02:42
Show Gist options
  • Save ponko2/8c63ee2110b7397e126f to your computer and use it in GitHub Desktop.
Save ponko2/8c63ee2110b7397e126f to your computer and use it in GitHub Desktop.
Laravel ElixirでBootstrapを使う時の設定
// resources/assets/sass/app.scss
@charset 'UTF-8';
// Bootstrap
@import 'bootstrap/variables';
@import 'node_modules/bootstrap-sass/assets/stylesheets/bootstrap';
// Font Awesome
@import 'font-awesome/variables';
@import 'node_modules/font-awesome/scss/font-awesome';
// resources/assets/sass/bootstrap/_variables.scss
@charset 'UTF-8';
// Load fonts from this directory.
$icon-font-path: '/vendor/bootstrap/fonts/';
// resources/assets/sass/font-awesome/_variables.scss
@charset 'UTF-8';
// Load fonts from this directory.
$fa-font-path: '/vendor/font-awesome/fonts';
'use strict';
const elixir = require('laravel-elixir');
elixir((mix) => {
mix.sass('app.scss')
.browserify('main.js')
.copy(
'node_modules/bootstrap-sass/assets/fonts/bootstrap',
'public/vendor/bootstrap/fonts'
)
.copy(
'node_modules/font-awesome/fonts',
'public/vendor/font-awesome/fonts'
);
});
// resources/assets/js/main.js
'use strict';
const $ = require('jquery');
window.jQuery = $;
window.$ = $;
require('bootstrap-sass');
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"bootstrap-sass": "^3.3.5",
"font-awesome": "^4.4.0",
"jquery": "^1.11.3",
"laravel-elixir": "^3.3.3"
},
"engines": {
"node": ">=4.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment