Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
chore: add example of mult style
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherdwind committed Feb 11, 2018
1 parent bbe7ba5 commit 047876b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions examples/simple/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
<title>css hot loader example</title>

<link rel="stylesheet" href="output.css">
<link rel="stylesheet" href="bar.css">
</head>
<body>

<!-- React stuff -->
<div id="root"> hello world</div>
<div class="bar">hello world bar</div>

<script src="output.js"></script> <!-- webpack javascript output -->
<script src="bar.js"></script> <!-- webpack javascript output -->

</body>
</html>
Expand Down
5 changes: 5 additions & 0 deletions examples/simple/src/bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.bar {
color: #ddd;
font-size: 50px;
text-align: center;
}
2 changes: 2 additions & 0 deletions examples/simple/src/bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
console.log('bar inited');
require('./bar.css');
2 changes: 1 addition & 1 deletion examples/simple/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ body {
text-align: center;
padding-top: 100px;
color: #666;
font-size: 40px;
font-size: 30px;
}
3 changes: 2 additions & 1 deletion examples/simple/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin'); // requ
let config = { // config object
entry: {
output: './src/index.js', // entry file
bar: './src/bar.js', // entry file
},
output: { // output
path: path.resolve(__dirname, 'dist'), // ouput path
Expand All @@ -22,7 +23,7 @@ let config = { // config object
] // end rules
},
plugins: [ // webpack plugins
new ExtractTextWebpackPlugin('output.css'),
new ExtractTextWebpackPlugin('[name].css'),
],
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
Expand Down

0 comments on commit 047876b

Please sign in to comment.