Skip to content

Commit c8172ea

Browse files
committed
Add bootstrap-sass gem; Use bootstrap-sass loader with local webpack dev server
1 parent 8b44d97 commit c8172ea

14 files changed

+116
-37
lines changed

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gem 'rails_12factor'
1212

1313
# Use SCSS for stylesheets
1414
gem 'sass-rails', '~> 5.0.0.beta1'
15+
gem 'bootstrap-sass', '~> 3.3.1'
1516
# Use Uglifier as compressor for JavaScript assets
1617
gem 'uglifier', '>= 1.3.0'
1718
# Use CoffeeScript for .js.coffee assets and views
@@ -37,6 +38,8 @@ gem 'rails-html-sanitizer', '~> 1.0'
3738
# Use Unicorn as the app server
3839
gem 'unicorn'
3940

41+
gem 'autoprefixer-rails'
42+
4043
# Use Capistrano for deployment
4144
# gem 'capistrano-rails', group: :development
4245

@@ -53,5 +56,3 @@ group :development, :test do
5356
# Manage application processes
5457
gem 'foreman'
5558
end
56-
57-
gem 'autoprefixer-rails'

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ GEM
3939
execjs
4040
binding_of_caller (0.7.3.pre1)
4141
debug_inspector (>= 0.0.1)
42+
bootstrap-sass (3.3.1.0)
43+
sass (~> 3.2)
4244
builder (3.2.2)
4345
byebug (3.2.0)
4446
columnize (~> 0.8)
@@ -163,6 +165,7 @@ PLATFORMS
163165

164166
DEPENDENCIES
165167
autoprefixer-rails
168+
bootstrap-sass (~> 3.3.1)
166169
byebug
167170
coffee-rails (~> 4.0.0)
168171
foreman

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ Setup node and run the node server.
2929

3030
```
3131
npm install
32-
cd webpack && webpack --config webpack.hot.config.js
33-
node server.js
32+
cd webpack && node server.js
3433
```
3534

3635
Point browser to [http://0.0.0.0:3000]().
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@import "../../../webpack/assets/stylesheets/test-stylesheet";
22
@import "../../../webpack/assets/stylesheets/test-sass-stylesheet";
3-
@import "bootstrap-and-customizations";
3+
@import "bootstrap-sprockets";
4+
@import "bootstrap";

webpack/_bootstrap-customizations.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ $pre-border-color: $pre-bg; // hide the border.
77

88
// This makes the font on the buttons and the text BIG
99
$font-size-base: 18px;
10-

webpack/assets/javascripts/CommentBox.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module React from 'react/addons';
77
// the React Developer Tools: http://facebook.github.io/react/blog/2014/01/02/react-chrome-developer-tools.html
88
// require("expose?React!react");
99

10-
1110
var Input = require('react-bootstrap/Input');
1211
var Button = require('react-bootstrap/Button');
1312
var Row = require('react-bootstrap/Row');

webpack/bootstrap-sass.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ module.exports = {
1212
'transition': true,
1313
'alert': true,
1414
'button': true,
15-
'carousel': true,
15+
'carousel': false,
1616
'collapse': true,
1717
'dropdown': true,
18-
'modal': true,
18+
'modal': false,
1919
'tooltip': true,
2020
'popover': true,
2121
'scrollspy': true,
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
//var ExtractTextPlugin = require("extract-text-webpack-plugin");
2+
3+
module.exports = {
4+
bootstrapCustomizations: "./_bootstrap-customizations.scss",
5+
mainSass: "./_main.scss",
6+
7+
// Default for the style loading is to put in your js files
8+
// styleLoader: "style-loader!css-loader!sass-loader";
9+
// styleLoader: ExtractTextPlugin.extract("style-loader", "css-loader"),
10+
11+
// ### Scripts
12+
// Any scripts here set to false will never make it to the client,
13+
// i.e. it's not packaged by webpack.
14+
scripts: {
15+
'transition': true,
16+
'alert': true,
17+
'button': true,
18+
'carousel': true,
19+
'collapse': true,
20+
'dropdown': true,
21+
'modal': false,
22+
'tooltip': true,
23+
'popover': true,
24+
'scrollspy': true,
25+
'tab': true,
26+
'affix': true
27+
},
28+
// ### Styles
29+
// Enable or disable certain less components and thus remove
30+
// the css for them from the build.
31+
styles: {
32+
"mixins": true,
33+
34+
"normalize": true,
35+
"print": true,
36+
37+
"scaffolding": true,
38+
"type": true,
39+
"code": true,
40+
"grid": true,
41+
"tables": true,
42+
"forms": true,
43+
"buttons": true,
44+
45+
"component-animations": true,
46+
"glyphicons": true,
47+
"dropdowns": true,
48+
"button-groups": true,
49+
"input-groups": true,
50+
"navs": true,
51+
"navbar": true,
52+
"breadcrumbs": true,
53+
"pagination": true,
54+
"pager": true,
55+
"labels": true,
56+
"badges": true,
57+
"jumbotron": true,
58+
"thumbnails": true,
59+
"alerts": true,
60+
"progress-bars": true,
61+
"media": true,
62+
"list-group": true,
63+
"panels": true,
64+
"wells": true,
65+
"close": true,
66+
67+
"modals": true,
68+
"tooltip": true,
69+
"popovers": true,
70+
"carousel": true,
71+
72+
"utilities": true,
73+
"responsive-utilities": true
74+
}
75+
};

webpack/scripts/rails_only.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@
44
// Showing this for example purposes
55
// require("expose?$!jquery");
66
// require("expose?jQuery!jquery");
7-
8-

webpack/scripts/webpack_only.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
// These are only loaded by only by the webpack server
1+
// These are only loaded by the webpack dev server
22

3-
// Option to load stylesheets via webpack
43
require("test-stylesheet.css");
5-
6-
// Test out sass
7-
require("test-sass-stylesheet.scss");
4+
require("test-sass-stylesheet.scss"); // test out sass
85

96
require("expose?$!jquery");
107
require("expose?jQuery!jquery");
11-
require("bootstrap-webpack");

0 commit comments

Comments
 (0)