From 8a1070ba436dc8bd69af5d544f61054452bb60ca Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Sat, 10 Sep 2016 21:09:33 +0700 Subject: [PATCH 1/2] Specify cache directory for babel loader --- config/babel.dev.js | 6 ++++-- package.json | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/babel.dev.js b/config/babel.dev.js index d122f108150..e0753072106 100644 --- a/config/babel.dev.js +++ b/config/babel.dev.js @@ -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/create-react-app/ + // directory for faster rebuilds. + cacheDirectory: findCacheDir({ name: 'create-react-app' }), presets: [ // Latest stable ECMAScript features require.resolve('babel-preset-latest'), diff --git a/package.json b/package.json index a6bf6f384ab..6c60f218dba 100644 --- a/package.json +++ b/package.json @@ -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", From 75965f1bfc3f22e08d65b2947c1cb96d26d99623 Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Sun, 11 Sep 2016 02:24:22 +0700 Subject: [PATCH 2/2] Use `react-scripts` for folder name instead --- config/babel.dev.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/babel.dev.js b/config/babel.dev.js index e0753072106..ee7d4fdf6db 100644 --- a/config/babel.dev.js +++ b/config/babel.dev.js @@ -16,9 +16,9 @@ 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 ./node_modules/.cache/create-react-app/ + // It enables caching results in ./node_modules/.cache/react-scripts/ // directory for faster rebuilds. - cacheDirectory: findCacheDir({ name: 'create-react-app' }), + cacheDirectory: findCacheDir({ name: 'react-scripts' }), presets: [ // Latest stable ECMAScript features require.resolve('babel-preset-latest'),