extracting css file

This commit is contained in:
Cássio Zen 2016-07-18 15:07:45 -03:00
parent b991b1af26
commit 8fdb46f085
3 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@
<title>This is an example</title> <title>This is an example</title>
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/cms.css"/>
<script> <script>
window.repoFiles = { window.repoFiles = {
_posts: { _posts: {
@ -65,6 +66,7 @@
</script> </script>
</head> </head>
<body> <body>
<script src='/cms.js'></script> <script src='/cms.js'></script>
</body> </body>
</html> </html>

View File

@ -36,6 +36,7 @@
"eslint-loader": "^1.2.1", "eslint-loader": "^1.2.1",
"eslint-plugin-react": "^5.1.1", "eslint-plugin-react": "^5.1.1",
"exports-loader": "^0.6.3", "exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^1.0.1",
"express": "^4.13.4", "express": "^4.13.4",
"file-loader": "^0.8.5", "file-loader": "^0.8.5",
"immutable": "^3.7.6", "immutable": "^3.7.6",

View File

@ -1,5 +1,6 @@
/* global module, __dirname, require */ /* global module, __dirname, require */
var webpack = require('webpack'); var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path'); var path = require('path');
module.exports = { module.exports = {
@ -12,7 +13,7 @@ module.exports = {
{ test: /\.json$/, loader: 'json-loader' }, { test: /\.json$/, loader: 'json-loader' },
{ {
test: /\.css$/, test: /\.css$/,
loader: 'style!css?modules&importLoaders=1!postcss' loader: ExtractTextPlugin.extract("style", "css?modules&importLoaders=1!postcss"),
}, },
{ {
loader: 'babel', loader: 'babel',
@ -33,6 +34,7 @@ module.exports = {
], ],
plugins: [ plugins: [
new ExtractTextPlugin('cms.css', { allChunks: true }),
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}) })