Commit 66702915 authored by Khoa Nguyen's avatar Khoa Nguyen Committed by Ville Immonen
Browse files

Avoid tons of *.json.gzip-files created in project root when running with docker node (#620)

* Specify cache directory for babel loader

* Use `react-scripts` for folder name instead
parent cdd736d9
Showing with 5 additions and 2 deletions
+5 -2
...@@ -10,13 +10,15 @@ ...@@ -10,13 +10,15 @@
// @remove-on-eject-end // @remove-on-eject-end
var path = require('path'); var path = require('path');
var findCacheDir = require('find-cache-dir');
module.exports = { module.exports = {
// Don't try to find .babelrc because we want to force this configuration. // Don't try to find .babelrc because we want to force this configuration.
babelrc: false, babelrc: false,
// This is a feature of `babel-loader` for webpack (not Babel itself). // This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in OS temporary directory for faster rebuilds. // It enables caching results in ./node_modules/.cache/react-scripts/
cacheDirectory: true, // directory for faster rebuilds.
cacheDirectory: findCacheDir({ name: 'react-scripts' }),
presets: [ presets: [
// Latest stable ECMAScript features // Latest stable ECMAScript features
require.resolve('babel-preset-latest'), require.resolve('babel-preset-latest'),
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"extract-text-webpack-plugin": "1.0.1", "extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0", "file-loader": "0.9.0",
"filesize": "3.3.0", "filesize": "3.3.0",
"find-cache-dir": "^0.1.1",
"fs-extra": "0.30.0", "fs-extra": "0.30.0",
"gzip-size": "3.0.0", "gzip-size": "3.0.0",
"html-loader": "0.4.3", "html-loader": "0.4.3",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment