Skip to content

Commit

Permalink
Avoid tons of *.json.gzip-files created in project root when running …
Browse files Browse the repository at this point in the history
…with docker node (facebook#620)

* Specify cache directory for babel loader

* Use `react-scripts` for folder name instead
  • Loading branch information
thangngoc89 authored and feiqitian committed Oct 25, 2016
1 parent 3ffe8c5 commit aad08e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
// @remove-on-eject-end

var path = require('path');
var findCacheDir = require('find-cache-dir');

module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in OS temporary directory for faster rebuilds.
cacheDirectory: true,
// It enables caching results in ./node_modules/.cache/react-scripts/
// directory for faster rebuilds.
cacheDirectory: findCacheDir({ name: 'react-scripts' }),
presets: [
// Latest stable ECMAScript features
require.resolve('babel-preset-latest'),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0",
"filesize": "3.3.0",
"find-cache-dir": "^0.1.1",
"fs-extra": "0.30.0",
"gzip-size": "3.0.0",
"html-loader": "0.4.3",
Expand Down

0 comments on commit aad08e2

Please sign in to comment.