Skip to content

Commit

Permalink
Disable babel cache for production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
geowarin committed Jun 15, 2016
1 parent 6050e35 commit 4d9aa8c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/loaders/babel.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
'use strict';

module.exports = [
(context) => ({
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/,
query: Object.assign({}, context.webpackBabelConfig, {cacheDirectory: true})
})
(context) => {
let babelConfig = context.webpackBabelConfig;
if (process.env['NODE_ENV'] !== 'production') {
babelConfig = Object.assign({}, context.webpackBabelConfig, {cacheDirectory: true});
}
return {
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/,
query: babelConfig
}
}
];

0 comments on commit 4d9aa8c

Please sign in to comment.