1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-01-17 21:58:27 +01:00

build(storybook): Add hot reloading to storybook

I've added hot reloading to Storybook. This means that during development, all we have to do is run
Storybook. As we make changes to the SCSS files, the changes will automatically be reflected in
Storybook. 😁
This commit is contained in:
Trezy 2018-12-10 22:57:51 -06:00
parent 8acab18bfd
commit abbd67ce13
4 changed files with 112 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { configure } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
import '../css/nes.css'; // eslint-disable-line import/no-unresolved
import '../scss/nes.scss'; // eslint-disable-line import/no-unresolved
// automatically import all files ending in *.stories.js
const req = require.context('../docs', true, /.stories.js$/);

View File

@ -0,0 +1,18 @@
const path = require('path');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../'),
},
{
test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
loader: 'file-loader',
// loader: 'url-loader?limit=100000',
},
],
},
};

80
package-lock.json generated
View File

@ -3293,6 +3293,29 @@
}
}
},
"clone-deep": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-2.0.2.tgz",
"integrity": "sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ==",
"dev": true,
"requires": {
"for-own": "^1.0.0",
"is-plain-object": "^2.0.4",
"kind-of": "^6.0.0",
"shallow-clone": "^1.0.0"
},
"dependencies": {
"for-own": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
"integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
"dev": true,
"requires": {
"for-in": "^1.0.1"
}
}
}
},
"clone-regexp": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.1.tgz",
@ -8450,6 +8473,12 @@
"integrity": "sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg=",
"dev": true
},
"lodash.tail": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz",
"integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=",
"dev": true
},
"lodash.template": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz",
@ -8872,6 +8901,24 @@
}
}
},
"mixin-object": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz",
"integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=",
"dev": true,
"requires": {
"for-in": "^0.1.3",
"is-extendable": "^0.1.1"
},
"dependencies": {
"for-in": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz",
"integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=",
"dev": true
}
}
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
@ -15112,6 +15159,20 @@
"yargs": "^7.0.0"
}
},
"sass-loader": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.1.0.tgz",
"integrity": "sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w==",
"dev": true,
"requires": {
"clone-deep": "^2.0.1",
"loader-utils": "^1.0.1",
"lodash.tail": "^4.1.1",
"neo-async": "^2.5.0",
"pify": "^3.0.0",
"semver": "^5.5.0"
}
},
"scheduler": {
"version": "0.11.3",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.11.3.tgz",
@ -15923,6 +15984,25 @@
"safe-buffer": "^5.0.1"
}
},
"shallow-clone": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-1.0.0.tgz",
"integrity": "sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA==",
"dev": true,
"requires": {
"is-extendable": "^0.1.1",
"kind-of": "^5.0.0",
"mixin-object": "^2.0.1"
},
"dependencies": {
"kind-of": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
"integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
"dev": true
}
}
},
"shallowequal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",

View File

@ -44,16 +44,18 @@
"babel-loader": "^8.0.4",
"clean-css-cli": "^4.2.1",
"commitizen": "^3.0.5",
"cz-conventional-changelog": "^2.1.0",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"cz-conventional-changelog": "^2.1.0",
"file-loader": "^2.0.0",
"husky": "^1.0.0",
"lint-staged": "^7.3.0",
"node-sass": "^4.9.3",
"postcss-cli": "^6.0.0",
"prettier": "^1.15.2",
"rimraf": "^2.6.2",
"sass-loader": "^7.1.0",
"semantic-release": "^15.12.3",
"stylelint": "^9.5.0",
"stylelint-config-prettier": "^4.0.0",
@ -70,8 +72,16 @@
"@commitlint/config-conventional"
],
"rules": {
"subject-case": [0, "never", "sentence-case"],
"subject-full-stop": [0, "never", "."]
"subject-case": [
0,
"never",
"sentence-case"
],
"subject-full-stop": [
0,
"never",
"."
]
}
},
"husky": {