Sha256: c41f2d5bf2ecec676cd4c7be6bce33f53a81f2d04bb1c0512205d88732e4f925
Contents?: true
Size: 972 Bytes
Versions: 20
Compression:
Stored size: 972 Bytes
Contents
<%= add_documentation_reference(config[:message], "// https://github.com/shakacode/react_on_rails_demo_ssr_hmr/blob/master/babel.config.js") %> module.exports = function (api) { const defaultConfigFunc = require('shakapacker/package/babel/preset.js') const resultConfig = defaultConfigFunc(api) const isProductionEnv = api.env('production') const changesOnDefault = { presets: [ [ '@babel/preset-react', { development: !isProductionEnv, useBuiltIns: true } ] ].filter(Boolean), plugins: [ process.env.WEBPACK_SERVE && 'react-refresh/babel', isProductionEnv && ['babel-plugin-transform-react-remove-prop-types', { removeImport: true } ] ].filter(Boolean), } resultConfig.presets = [...resultConfig.presets, ...changesOnDefault.presets] resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins ] return resultConfig }
Version data entries
20 entries across 20 versions & 1 rubygems