Commit 49f2f9f8 by hfpp2012 yinsigan

css module

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