Skip to content

Commit 2134437

Browse files
Judahmeekjustin808
authored andcommitted
Update Example Dependencies (#261)
1 parent 30aaabf commit 2134437

22 files changed

+9923
-158
lines changed

examples/basic/package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"lint": "eslint --ext .js .",
1414
"build": "npm run clean && webpack --config webpack.prod.config.js",
1515
"prod": "nodemon --watch app/markup --ext html server.prod.js",
16+
"post-install": "echo 'module.exports = {}' >> node_modules/bootstrap-loader/postcss.config.js",
1617
"bs:no-config": "npm run cleanrc && npm start",
1718
"bs3": "npm run cleanrc && BOOTSTRAPRC_LOCATION=.bootstraprc-3-example nodemon --watch app/markup --ext html server.dev.js",
1819
"bs4": "npm run cleanrc && BOOTSTRAPRC_LOCATION=.bootstraprc-4-example nodemon --watch app/markup --ext html server.dev.js",
@@ -24,7 +25,7 @@
2425
"bs4:default:dev": "npm run bs4:default:setup && npm start",
2526
"bs3:default:prod": "npm run bs3:default:setup && npm run build && npm run prod",
2627
"bs4:default:prod": "npm run bs4:default:setup && npm run build && npm run prod",
27-
"install-local": "npm install --save-dev ../.."
28+
"install-local": "rm -rf node_modules/bootstrap-loader && npm install --save-dev ../.. && npm run post-install"
2829
},
2930
"repository": {
3031
"type": "git",
@@ -40,9 +41,9 @@
4041
],
4142
"license": "MIT",
4243
"dependencies": {
43-
"express": "^4.14.0",
4444
"bootstrap": "4.0.0-alpha.4",
4545
"bootstrap-sass": "^3.3.7",
46+
"express": "^4.14.0",
4647
"font-awesome": "^4.7.0",
4748
"jquery": "^3.1.1",
4849
"tether": "^1.3.7"
@@ -54,24 +55,28 @@
5455
"babel-loader": "^6.2.8",
5556
"babel-preset-es2015": "^6.18.0",
5657
"body-parser": "^1.15.2",
57-
"bootstrap-loader": "file:///Users/judahmeek/Apps/bootstrap-loader",
58+
"bootstrap-loader": "file:../..",
5859
"css-loader": "^0.26.0",
5960
"eslint": "^3.10.2",
6061
"eslint-config-shakacode": "^13.1.0",
6162
"eslint-plugin-import": "^2.2.0",
6263
"extract-text-webpack-plugin": "^2.0.0-beta",
63-
"file-loader": "^0.9.0",
64+
"file-loader": "^0.10.0",
6465
"font-awesome-loader": "^1.0.1",
65-
"imports-loader": "^0.6.5",
66-
"node-sass": "^3.13.0",
66+
"imports-loader": "^0.7.0",
67+
"node-sass": "^4.5.0",
6768
"nodemon": "^1.11.0",
6869
"postcss-loader": "^1.1.1",
69-
"resolve-url-loader": "^1.6.0",
70-
"sass-loader": "^4.0.2",
70+
"resolve-url-loader": "^2.0.0",
71+
"sass-loader": "^6.0.0",
7172
"style-loader": "^0.13.1",
7273
"url-loader": "^0.5.7",
7374
"webpack": "^2.1.0-beta",
7475
"webpack-dev-middleware": "^1.8.4",
7576
"webpack-hot-middleware": "^2.13.2"
77+
},
78+
"peerDependencies": {
79+
"eslint-plugin-jsx-a11y": "^2.2.3",
80+
"eslint-plugin-react": "^6.6.0"
7681
}
7782
}

examples/basic/server.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint no-console: 0 */
1+
/* eslint-disable no-console, import/no-extraneous-dependencies */
22

33
const path = require('path');
44
const express = require('express');
@@ -33,7 +33,7 @@ server.use(webpackHotMiddleware(compiler));
3333
server.use(bodyParser.json());
3434
server.use(bodyParser.urlencoded({ extended: true }));
3535

36-
server.use('/', (req, res) => (
36+
server.use('/', (req, res) => ( // eslint-disable-line no-unused-vars
3737
res.sendFile(path.join(__dirname, 'app', 'markup', 'bootstrap-dev.html'))
3838
));
3939

examples/basic/server.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint no-console: 0 */
1+
/* eslint-disable no-console, import/no-extraneous-dependencies */
22

33
const path = require('path');
44
const express = require('express');
@@ -14,7 +14,7 @@ server.use(bodyParser.urlencoded({ extended: true }));
1414

1515
server.use(express.static(path.join(__dirname, 'public')));
1616

17-
server.use('/', (req, res) => (
17+
server.use('/', (req, res) => ( // eslint-disable-line no-unused-vars
1818
res.sendFile(path.join(__dirname, 'app', 'markup', 'bootstrap-prod.html'))
1919
));
2020

examples/basic/webpack.dev.config.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
// Very similar to webpack.prod.config.js. Common parts could be extracted to a base config.
23
// See example at:
34
// https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client%2Fwebpack.client.base.config.js
@@ -31,7 +32,7 @@ module.exports = {
3132

3233
plugins: [
3334
new webpack.HotModuleReplacementPlugin(),
34-
new webpack.NoErrorsPlugin(),
35+
new webpack.NoEmitOnErrorsPlugin(),
3536
new webpack.ProvidePlugin({
3637
'window.Tether': 'tether',
3738
}),
@@ -41,25 +42,25 @@ module.exports = {
4142
],
4243

4344
module: {
44-
loaders: [
45-
{ test: /\.css$/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] },
46-
{ test: /\.scss$/, loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] },
45+
rules: [
46+
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader'] },
47+
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'] },
4748
{
4849
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
49-
loader: 'url-loader?limit=10000',
50+
use: 'url-loader?limit=10000',
5051
},
5152
{
5253
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
53-
loader: 'file-loader',
54+
use: 'file-loader',
5455
},
5556

5657
// Use one of these to serve jQuery for Bootstrap scripts:
5758

5859
// Bootstrap 4
59-
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' },
60+
{ test: /bootstrap\/dist\/js\/umd\//, use: 'imports-loader?jQuery=jquery' },
6061

6162
// Bootstrap 3
62-
{ test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports-loader?jQuery=jquery' },
63+
{ test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery' },
6364
],
6465
},
6566

examples/basic/webpack.prod.config.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-extraneous-dependencies, object-property-newline */
12
// Very similar to webpack.dev.config.js. Common parts could be extracted to a base config.
23
// See example at:
34
// https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client%2Fwebpack.client.base.config.js
@@ -40,32 +41,32 @@ module.exports = {
4041
],
4142

4243
module: {
43-
loaders: [
44-
{ test: /\.css$/, loader: ExtractTextPlugin.extract({
45-
fallbackLoader: 'style-loader', loader: 'css-loader!postcss-loader',
44+
rules: [
45+
{ test: /\.css$/, use: ExtractTextPlugin.extract({
46+
fallback: 'style-loader', use: 'css-loader!postcss-loader',
4647
}) },
47-
{ test: /\.scss$/, loader: ExtractTextPlugin.extract({
48-
fallbackLoader: 'style-loader', loader: 'css-loader!postcss-loader!sass-loader',
48+
{ test: /\.scss$/, use: ExtractTextPlugin.extract({
49+
fallback: 'style-loader', use: 'css-loader!postcss-loader!sass-loader',
4950
}) },
5051

5152
{
5253
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
5354
// Limiting the size of the woff fonts breaks font-awesome ONLY for the extract text plugin
54-
// loader: "url?limit=10000"
55-
loader: 'url-loader',
55+
// use: "url?limit=10000"
56+
use: 'url-loader',
5657
},
5758
{
5859
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
59-
loader: 'file-loader',
60+
use: 'file-loader',
6061
},
6162

6263
// Use one of these to serve jQuery for Bootstrap scripts:
6364

6465
// Bootstrap 4
65-
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' },
66+
{ test: /bootstrap\/dist\/js\/umd\//, use: 'imports-loader?jQuery=jquery' },
6667

6768
// Bootstrap 3
68-
{ test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports-loader?jQuery=jquery' },
69+
{ test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery' },
6970
],
7071
},
7172

0 commit comments

Comments
 (0)