Skip to content

Commit

Permalink
step 2 - extract styles
Browse files Browse the repository at this point in the history
  • Loading branch information
bognix committed Feb 27, 2017
1 parent 254dc81 commit 0c67cda
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Webpack Example</title>
<link rel="stylesheet" type="text/css" href="bundle.css">
</head>
<body>
<script src="bundle.js"></script>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"babel-loader": "^6.3.2",
"babel-preset-es2015": "^6.22.0",
"css-loader": "^0.26.2",
"extract-text-webpack-plugin": "^2.0.0",
"style-loader": "^0.13.2",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.4.1"
Expand Down
21 changes: 13 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import ExtractTextPlugin from 'extract-text-webpack-plugin';

const extractStyles = new ExtractTextPlugin({
filename: 'bundle.css'
});

module.exports = {
entry: [
'./example/index.js'
Expand All @@ -13,13 +19,12 @@ module.exports = {
exclude: /node_modules/
}, {
test: /\.css$/,
use: [
{
loader: 'style-loader'
}, {
loader: 'css-loader'
}
]}
use: extractStyles.extract({
use: 'css-loader'
})
}]
},
plugins: [
extractStyles
]
}
};

0 comments on commit 0c67cda

Please sign in to comment.