Skip to content

Commit

Permalink
- Use css-loader/locals in the prerendering bundle to only export ide…
Browse files Browse the repository at this point in the history
  • Loading branch information
choonkending committed Dec 11, 2016
1 parent ba2f0a4 commit efd7418
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var nodeModules = fs.readdirSync('node_modules')
return acc;
}, {});

var postCSSConfig = function () {
var postCSSConfig = function() {
return [
require('postcss-import')(),
require('postcss-cssnext')({
Expand All @@ -27,6 +27,7 @@ var postCSSConfig = function () {
];
};


module.exports = [
{
// The configuration for the client
Expand Down Expand Up @@ -95,9 +96,9 @@ module.exports = [
}, {
// The configuration for the server-side rendering
name: 'server-side rendering',
context: path.join(__dirname, '..', 'server'),
context: path.join(__dirname, '..', 'app'),
entry: {
server: './index'
server: '../server/index'
},
target: 'node',
node: {
Expand All @@ -114,7 +115,8 @@ module.exports = [
},
module: {
loaders: commonLoaders.concat({
test: /\.css$/, loader: 'ignore-loader'
test: /\.css$/,
loader: 'css/locals?module!postcss-loader'
})
},
resolve: {
Expand All @@ -138,6 +140,7 @@ module.exports = [
warnings: false
}
})
]
],
postcss: postCSSConfig
}
];

0 comments on commit efd7418

Please sign in to comment.