Skip to content

Commit 046079b

Browse files
committed
feat(package): add [email protected] and css loaders
1 parent fe6bef2 commit 046079b

7 files changed

Lines changed: 21 additions & 4 deletions

File tree

docs/lib/app.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'bootstrap-css';
2+
13
import React from 'react';
24
import ReactDOM from 'react-dom';
35
import ReactDOMServer from 'react-dom/server';
@@ -33,8 +35,8 @@ export default (locals, callback) => {
3335
<head>
3436
<title>reactstrap - React Bootstrap 4 components</title>
3537
<link rel=icon href=/assets/favicon.ico>
36-
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
3738
<link rel="stylesheet" href="/assets/docs.css"/>
39+
<link rel="stylesheet" href="/assets/style.css"/>
3840
</head>
3941
<body>
4042
<div id="app">${body}</div>

example/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<html>
33
<head>
44
<title>React Bootstrap</title>
5-
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
65
</head>
76
<body class="m-a-2">
87
<div id="app"></div>
98
<script type="text/javascript" src="https://fb.me/react-0.14.7.js"></script>
109
<script type="text/javascript" src="https://fb.me/react-dom-0.14.7.js"></script>
1110
<script src="/assets/reactstrap.js"></script>
1211
<script src="/assets/demo.js"></script>
12+
<link rel="stylesheet" href="/assets/style.css"/>
1313
</body>
1414
</html>

example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<html>
33
<head>
44
<title>React Bootstrap</title>
5-
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
65
</head>
76
<body class="m-b-2">
87
<div id="app"></div>
98
<script src="/assets/example.js"></script>
9+
<link rel="stylesheet" href="/assets/style.css"/>
1010
</body>
1111
</html>

example/js/app.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'bootstrap-css';
2+
13
import React from 'react';
24
import ReactDOM from 'react-dom';
35
import Layout from './Layout';

example/js/demo.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'bootstrap-css';
2+
13
const {
24
Button,
35
ButtonDropdown,

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@
5555
"babel-preset-es2015": "^6.5.0",
5656
"babel-preset-react": "^6.5.0",
5757
"babel-preset-stage-0": "^6.5.0",
58+
"bootstrap": "^4.0.0-alpha.2",
5859
"cheerio": "^0.20.0",
5960
"clean-webpack-plugin": "^0.1.8",
6061
"conventional-changelog-cli": "^1.1.1",
6162
"conventional-recommended-bump": "^0.1.2",
6263
"copy-webpack-plugin": "^1.1.1",
6364
"coveralls": "^2.11.8",
65+
"css-loader": "^0.23.1",
6466
"ejs": "^2.4.1",
6567
"enzyme": "^2.1.0",
6668
"eslint": "^2.0.0",
6769
"eslint-plugin-react": "^3.16.1",
6870
"eslint-plugin-standard": "^1.3.2",
71+
"extract-text-webpack-plugin": "^1.0.1",
6972
"history": "^2.0.1",
7073
"isparta-loader": "^2.0.0",
7174
"jasmine-core": "^2.4.1",
@@ -90,6 +93,7 @@
9093
"react-prism": "^3.1.1",
9194
"react-router": "^2.0.1",
9295
"static-site-generator-webpack-plugin": "^2.0.1",
96+
"style-loader": "^0.13.1",
9397
"webpack": "^1.12.13",
9498
"webpack-dev-server": "^1.14.1"
9599
}

webpack.dev.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var env = process.env.WEBPACK_BUILD || 'development';
55

66
var CleanWebpackPlugin = require('clean-webpack-plugin');
77
var CopyWebpackPlugin = require('copy-webpack-plugin');
8+
var ExtractTextPlugin = require("extract-text-webpack-plugin");
89
var webpackDevConfig = require('./webpack.base.config')('development');
910
var webpackProdConfig = require('./webpack.base.config')('production');
1011

@@ -45,7 +46,8 @@ var config = [{
4546
new webpack.optimize.DedupePlugin(),
4647
new webpack.optimize.OccurenceOrderPlugin(),
4748
new StaticSiteGeneratorPlugin('main', paths, {}),
48-
new webpack.NoErrorsPlugin()
49+
new webpack.NoErrorsPlugin(),
50+
new ExtractTextPlugin("/assets/style.css")
4951
],
5052
module: {
5153
loaders: [
@@ -62,11 +64,16 @@ var config = [{
6264
'babel-loader?cacheDirectory'
6365
]
6466
},
67+
{
68+
test: /\.css$/,
69+
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
70+
},
6571
]
6672
},
6773
resolve: {
6874
extensions: ['', '.js', '.jsx', '.json'],
6975
alias: {
76+
'bootstrap-css': path.join(__dirname,'node_modules/bootstrap/dist/css/bootstrap.css'),
7077
reactstrap: path.resolve('./lib')
7178
}
7279
}

0 commit comments

Comments
 (0)