about summary refs log tree commit diff
path: root/config/webpack/rules/node_modules.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-03-16 17:10:27 +0100
committerGitHub <noreply@github.com>2019-03-16 17:10:27 +0100
commit6af2300454c960ef83f7b7d31e9b829e0d5a8e38 (patch)
tree97325ab7ad5a572170637da7a72ba72b7231a02f /config/webpack/rules/node_modules.js
parentc2fa0f7c40bcc4064e8baaa221665eadd391c001 (diff)
parent0fbe90e2d3cfc2c5d1fd12ea564daa52a83ec0ac (diff)
Merge pull request #961 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'config/webpack/rules/node_modules.js')
-rw-r--r--config/webpack/rules/node_modules.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/config/webpack/rules/node_modules.js b/config/webpack/rules/node_modules.js
new file mode 100644
index 000000000..7ed05504b
--- /dev/null
+++ b/config/webpack/rules/node_modules.js
@@ -0,0 +1,23 @@
+const { join } = require('path');
+const { settings, env } = require('../configuration');
+
+module.exports = {
+  test: /\.(js|mjs)$/,
+  include: /node_modules/,
+  exclude: /@babel(?:\/|\\{1,2})runtime/,
+  use: [
+    {
+      loader: 'babel-loader',
+      options: {
+        babelrc: false,
+        plugins: [
+          'transform-react-remove-prop-types',
+        ],
+        cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
+        cacheCompression: env.NODE_ENV === 'production',
+        compact: false,
+        sourceMaps: false,
+      },
+    },
+  ],
+};