From 595758d0c114492354965f34c1f53881a861406b Mon Sep 17 00:00:00 2001 From: Yann PETITJEAN Date: Fri, 8 Nov 2019 16:03:33 +0000 Subject: [PATCH] It compiles 10 times faster! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ségolène Alquier <35140149+Segolene-Alquier@users.noreply.github.com> --- .babelrc.js | 23 +++++++++++++++++++++ package-lock.json | 51 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 1 + 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .babelrc.js diff --git a/.babelrc.js b/.babelrc.js new file mode 100644 index 0000000..689dc08 --- /dev/null +++ b/.babelrc.js @@ -0,0 +1,23 @@ +const plugins = [ + [ + 'babel-plugin-transform-imports', + { + '@material-ui/core': { + // Use "transform: '@material-ui/core/${member}'," if your bundler does not support ES modules + transform: '@material-ui/core/esm/${member}', + preventFullImport: true, + }, + '@material-ui/icons': { + // Use "transform: '@material-ui/icons/${member}'," if your bundler does not support ES modules + transform: '@material-ui/icons/esm/${member}', + preventFullImport: true, + }, + '@lodash': { + transform: '@lodash/${member}', + preventFullImport: true, + }, + }, + ], +]; + +module.exports = { plugins }; diff --git a/package-lock.json b/package-lock.json index e2ebc62..8acc5e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2472,6 +2472,16 @@ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" }, + "babel-plugin-transform-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-imports/-/babel-plugin-transform-imports-2.0.0.tgz", + "integrity": "sha512-65ewumYJ85QiXdcB/jmiU0y0jg6eL6CdnDqQAqQ8JMOKh1E52VPG3NJzbVKWcgovUR5GBH8IWpCXQ7I8Q3wjgw==", + "dev": true, + "requires": { + "@babel/types": "^7.4", + "is-valid-path": "^0.1.1" + } + }, "babel-plugin-transform-object-rest-spread": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", @@ -6366,9 +6376,9 @@ "integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==" }, "handlebars": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz", - "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz", + "integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", @@ -7046,6 +7056,32 @@ "is-path-inside": "^1.0.0" } }, + "is-invalid-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-invalid-path/-/is-invalid-path-0.1.0.tgz", + "integrity": "sha1-MHqFWzzxqTi0TqcNLGEQYFNxTzQ=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", @@ -7165,6 +7201,15 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-valid-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-valid-path/-/is-valid-path-0.1.1.tgz", + "integrity": "sha1-EQ+f90w39mPh7HkV60UfLbk6yd8=", + "dev": true, + "requires": { + "is-invalid-path": "^0.1.0" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", diff --git a/package.json b/package.json index 56b22a2..febc726 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ ] }, "devDependencies": { + "babel-plugin-transform-imports": "^2.0.0", "body-parser": "^1.19.0", "express": "^4.17.1", "nodemon": "^1.19.4"