Commit 49f2f9f8 by hfpp2012 yinsigan

css module

1 parent 5ce9631d
import React from 'react';
import '../main.scss';
import styles from '../main.scss';
export default class App extends React.Component {
render() {
return (
<div className='text-center'>
<div className={styles.textcenter}>
<h1>Hello World</h1>
</div>);
}
......
.text-center {
.textcenter {
text-align: center;
h1 {
padding: 20px;
......
......@@ -12,7 +12,11 @@ const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
const extractSass = ExtractTextPlugin.extract({
use: [{
loader: "css-loader"
loader: "css-loader",
query: {
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
}, {
loader: "sass-loader"
}],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!