Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Update Webpack to v2.2.1; update other npm modules (kriasoft#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzzy authored Feb 1, 2017
1 parent dc6fc99 commit e751641
Show file tree
Hide file tree
Showing 14 changed files with 1,778 additions and 1,199 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '7'
- '6'
env:
- CXX=g++-4.8
Expand All @@ -10,5 +11,5 @@ addons:
packages:
- g++-4.8
script:
- npm run lint
- npm run test
- yarn lint
- yarn test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and newcomers to the industry.
### Getting Started

* Follow the [getting started guide](./docs/getting-started.md) to download and run the project
([node](https://nodejs.org/) >= 5,
([node](https://nodejs.org/) >= 6,
**[node-gyp](https://github.com/nodejs/node-gyp#readme)**
and **[prerequisites](https://github.com/nodejs/node-gyp#installation)**)
* Check the [code recipes](./docs/recipes) used in this boilerplate, or share yours
Expand Down
48 changes: 27 additions & 21 deletions docs/recipes/how-to-use-sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,30 @@ Update [`webpack.config.js`](../../tools/webpack.config.js) file to use `sass-lo
const config = {
...
module: {
loaders: [
rules: [
...
{
test: /\.scss$/,
loaders: [
'isomorphic-style-loader',
`css-loader?${JSON.stringify({ sourceMap: isDebug, minimize: !isDebug })}`,
'postcss-loader?pack=sass',
'sass-loader',
use: [
{
loader: 'isomorphic-style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: isDebug,
minimize: !isDebug,
},
},
{
loader: 'postcss-loader',
options: {
config: './tools/postcss.sass.js',
},
},
{
loader: 'sass-loader',
},
],
},
...
Expand All @@ -44,24 +59,15 @@ const config = {

### Step 3

Add one more configuration (pack) for [PostCSS](https://github.com/postcss/postcss) named `sass` to
Add one more configuration (`tools/postcss.sass.js`) for [PostCSS](https://github.com/postcss/postcss) to
enable [Autoprefixer](https://github.com/postcss/autoprefixer) for your `.scss` files:

```js
const config = {
...
postcss(bundler) {
return {
defaults: [
...
],
sass: [
require('autoprefixer')(),
],
};
}
...
}
module.exports = () => ({
plugins: [
require('autoprefixer')(),
],
});
```

For more information visit https://github.com/jtangelder/sass-loader and https://github.com/sass/node-sass
111 changes: 57 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,108 +7,109 @@
"npm": ">=3.10"
},
"dependencies": {
"babel-polyfill": "^6.20.0",
"babel-runtime": "^6.20.0",
"bluebird": "^3.4.6",
"body-parser": "^1.15.2",
"babel-polyfill": "^6.22.0",
"babel-runtime": "^6.22.0",
"bluebird": "^3.4.7",
"body-parser": "^1.16.0",
"classnames": "^2.2.5",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"express": "^4.14.0",
"express-graphql": "^0.6.1",
"express": "^4.14.1",
"express-graphql": "^0.6.2",
"express-jwt": "^5.1.0",
"fastclick": "^1.0.6",
"fbjs": "^0.8.6",
"graphql": "^0.8.2",
"history": "^4.5.0",
"fbjs": "^0.8.8",
"graphql": "^0.9.1",
"history": "^4.5.1",
"isomorphic-style-loader": "^1.1.0",
"jsonwebtoken": "^7.2.1",
"node-fetch": "^1.6.3",
"normalize.css": "^5.0.0",
"passport": "^0.3.2",
"passport-facebook": "^2.1.1",
"pretty-error": "^2.0.2",
"query-string": "^4.2.3",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"sequelize": "^3.28.0",
"source-map-support": "^0.4.6",
"query-string": "^4.3.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"sequelize": "^3.30.1",
"source-map-support": "^0.4.11",
"sqlite3": "^3.1.8",
"universal-router": "^2.0.0",
"whatwg-fetch": "^2.0.1"
"whatwg-fetch": "^2.0.2"
},
"devDependencies": {
"assets-webpack-plugin": "^3.5.0",
"autoprefixer": "^6.5.3",
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"assets-webpack-plugin": "^3.5.1",
"autoprefixer": "^6.7.2",
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.8",
"babel-loader": "^6.2.10",
"babel-plugin-rewire": "^1.0.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-latest": "^6.22.0",
"babel-preset-react": "^6.22.0",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.16.0",
"babel-register": "^6.18.0",
"babel-template": "^6.16.0",
"babel-types": "^6.19.0",
"browser-sync": "^2.18.2",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.22.0",
"babel-template": "^6.22.0",
"babel-types": "^6.22.0",
"browser-sync": "^2.18.7",
"chai": "^3.5.0",
"chokidar": "^1.6.1",
"css-loader": "^0.26.0",
"css-loader": "^0.26.1",
"editorconfig-tools": "^0.1.1",
"enzyme": "^2.6.0",
"eslint": "^3.10.2",
"eslint-config-airbnb": "^13.0.0",
"enzyme": "^2.7.1",
"eslint": "^3.14.1",
"eslint-config-airbnb": "^14.0.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-css-modules": "^1.0.9",
"eslint-plugin-css-modules": "^2.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.7.1",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0",
"extend": "^3.0.0",
"file-loader": "^0.9.0",
"front-matter": "^2.1.1",
"file-loader": "^0.10.0",
"front-matter": "^2.1.2",
"git-repository": "^0.1.4",
"glob": "^7.1.1",
"json-loader": "^0.5.4",
"lint-staged": "^3.2.2",
"lint-staged": "^3.3.0",
"markdown-it": "^8.2.2",
"mkdirp": "^0.5.1",
"mocha": "^3.1.2",
"mocha": "^3.2.0",
"pixrem": "^3.0.2",
"pleeease-filters": "^3.0.0",
"postcss": "^5.2.5",
"postcss": "^5.2.11",
"postcss-calc": "^5.3.1",
"postcss-color-function": "^2.0.1",
"postcss-custom-media": "^5.0.1",
"postcss-custom-properties": "^5.0.1",
"postcss-custom-selectors": "^3.0.0",
"postcss-flexbugs-fixes": "^2.0.0",
"postcss-loader": "^1.1.1",
"postcss-flexbugs-fixes": "^2.1.0",
"postcss-loader": "^1.2.2",
"postcss-media-minmax": "^2.1.2",
"postcss-nested": "^1.0.0",
"postcss-nesting": "^2.3.1",
"postcss-partial-import": "^2.1.0",
"postcss-partial-import": "^3.1.0",
"postcss-pseudoelements": "^3.0.0",
"postcss-selector-matches": "^2.0.5",
"postcss-selector-not": "^2.0.0",
"postcss-url": "^5.1.2",
"pre-commit": "^1.2.2",
"raw-loader": "^0.5.1",
"react-addons-test-utils": "15.4.1",
"react-addons-test-utils": "^15.4.2",
"react-deep-force-update": "^2.0.1",
"react-hot-loader": "^3.0.0-beta.6",
"redbox-react": "^1.3.3",
"rimraf": "^2.5.4",
"sinon": "^2.0.0-pre.3",
"stylefmt": "^5.0.2",
"stylelint": "^7.6.0",
"stylelint-config-standard": "^15.0.0",
"sinon": "^2.0.0-pre.5",
"stylefmt": "^5.1.1",
"stylelint": "^7.7.1",
"stylelint-config-standard": "^15.0.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.3",
"webpack-hot-middleware": "^2.13.2",
"webpack-middleware": "^1.5.1"
"webpack": "^2.2.1",
"webpack-dev-middleware": "^1.9.0",
"webpack-hot-middleware": "^2.16.1",
"write-file-webpack-plugin": "^3.4.2"
},
"babel": {
"presets": [
Expand Down Expand Up @@ -155,9 +156,11 @@
"import/no-extraneous-dependencies": "off",
"react/forbid-prop-types": "off",
"react/jsx-filename-extension": "off",
"react/no-array-index-key": "off",
"react/no-danger": "off",
"react/no-unused-prop-types": "off",
"react/prefer-stateless-function": "off"
"react/prefer-stateless-function": "off",
"react/require-default-props": "off"
}
},
"stylelint": {
Expand Down Expand Up @@ -202,9 +205,9 @@
"lint:js": "eslint src tools",
"lint:css": "stylelint \"src/**/*.{css,less,scss,sss}\"",
"lint:staged": "lint-staged",
"lint": "npm run lint:js && npm run lint:css",
"lint": "yarn run lint:js && yarn run lint:css",
"test": "mocha \"src/**/*.test.js\" --require babel-register --require test/setup.js",
"test:watch": "npm run test -- --reporter min --watch",
"test:watch": "yarn run test -- --reporter min --watch",
"clean": "babel-node tools/run clean",
"copy": "babel-node tools/run copy",
"bundle": "babel-node tools/run bundle",
Expand Down
6 changes: 1 addition & 5 deletions src/routes/about/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export default {
path: '/about',

async action() {
const data = await new Promise((resolve) => {
require.ensure([], require => {
resolve(require('./about.md'));
}, 'about');
});
const data = await require.ensure([], require => require('./about.md'), 'about');

return {
title: data.title,
Expand Down
4 changes: 1 addition & 3 deletions src/routes/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export default {
return { redirect: '/login' };
}

const Admin = await new Promise((resolve) => {
require.ensure([], (require) => resolve(require('./Admin').default), 'admin');
});
const Admin = await require.ensure([], require => require('./Admin').default, 'admin');

return {
title,
Expand Down
6 changes: 1 addition & 5 deletions src/routes/privacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export default {
path: '/privacy',

async action() {
const data = await new Promise((resolve) => {
require.ensure([], require => {
resolve(require('./privacy.md'));
}, 'privacy');
});
const data = await require.ensure([], require => require('./privacy.md'), 'privacy');

return {
title: data.title,
Expand Down
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import passport from './core/passport';
import models from './data/models';
import schema from './data/schema';
import routes from './routes';
import assets from './assets'; // eslint-disable-line import/no-unresolved
import assets from './assets.json'; // eslint-disable-line import/no-unresolved
import { port, auth } from './config';

const app = express();
Expand Down
2 changes: 0 additions & 2 deletions tools/lib/markdown-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const MarkdownIt = require('markdown-it');
const fm = require('front-matter');

module.exports = function markdownLoader(source) {
this.cacheable();

const md = new MarkdownIt({
html: true,
linkify: true,
Expand Down
Loading

0 comments on commit e751641

Please sign in to comment.