This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"build:client": "webpack --config webpack.config.js", | |
"build:server": "BABEL_ENV=server babel src --out-dir ./build/server" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var _styles = { | |
'wrapper': 'fe15fdc7', | |
'button': 'ad030139' | |
}; | |
var _styles2 = _interopRequireDefault(_styles); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper { | |
display: flex; | |
} | |
.button { | |
color: red; | |
& :hover { | |
color: green; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styles from './styles.scss'; | |
console.log( | |
` | |
<div class="${styles.wrapper}"> | |
<button class="${styles.button}"> | |
Click Me | |
</button> | |
</div> | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
test: /\.scss$/, | |
loader: ExtractTextPlugin.extract({ | |
loader: [ | |
{ | |
loader: 'css-loader', | |
query: { | |
localIdentName: '[hash:8]', | |
modules: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
._6de768fc { | |
display: flex; } | |
._8e1229bd { | |
color: red; } | |
._8e1229bd :hover { | |
color: green; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": [ | |
["es2015"] | |
], | |
"env": { | |
"server": { | |
"plugins": [ | |
[ | |
"css-modules-transform", { | |
"preprocessCss": "./loaders/sass-loader.js", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sass = require('node-sass'); | |
module.exports = (data, file) => { | |
try { | |
return sass.renderSync({data, file}).css.toString('utf8'); | |
} catch (e) { | |
console.error(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var _styles = { | |
'wrapper': '_6de768fc', | |
'button': '_8e1229bd' | |
}; | |
var _styles2 = _interopRequireDefault(_styles); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
test: /\.scss$/, | |
loader: ExtractTextPlugin.extract({ | |
loader: [ | |
{ | |
loader: 'css-loader', | |
query: { | |
localIdentName: '[hash:8]', | |
modules: true | |
} |