diff --git a/webpack/rules/babel-git.js b/webpack/rules/babel-git.js new file mode 100644 index 000000000..0a1919e97 --- /dev/null +++ b/webpack/rules/babel-git.js @@ -0,0 +1,16 @@ +const { resolve } = require('path'); +const { env } = require('../configuration'); + +module.exports = { + test: resolve(__dirname, '../../app/soapbox/utils/code.js'), + use: [ + { + loader: 'babel-loader', + options: { + cacheDirectory: false, + cacheCompression: env.NODE_ENV === 'production', + compact: env.NODE_ENV === 'production', + }, + }, + ], +}; diff --git a/webpack/rules/index.js b/webpack/rules/index.js index 7cf12f0ab..ad172deff 100644 --- a/webpack/rules/index.js +++ b/webpack/rules/index.js @@ -1,4 +1,5 @@ const babel = require('./babel'); +const git = require('./babel-git'); const css = require('./css'); const file = require('./file'); const nodeModules = require('./node_modules'); @@ -11,4 +12,5 @@ module.exports = [ css, nodeModules, babel, + git, ];