This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/config/webpack/rules/node_modules.js

33 lines
808 B
JavaScript

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',
{
mode: 'remove',
removeImport: true,
additionalLibraries: [
'../../utils/shared-props', // emoji-mart
],
},
],
],
cacheDirectory: join(settings.cache_path, 'babel-loader-node-modules'),
cacheCompression: env.NODE_ENV === 'production',
compact: false,
sourceMaps: false,
},
},
],
};