()
| 66 | } |
| 67 | |
| 68 | function plugins() { |
| 69 | if (isESM) { |
| 70 | return [ |
| 71 | ...defaultPlugins, |
| 72 | [ |
| 73 | 'transform-define', |
| 74 | { |
| 75 | DECAP_CMS_APP_VERSION: `${appVersion}`, |
| 76 | DECAP_CMS_CORE_VERSION: `${coreVersion}`, |
| 77 | }, |
| 78 | ], |
| 79 | [ |
| 80 | 'inline-react-svg', |
| 81 | { |
| 82 | svgo, |
| 83 | }, |
| 84 | ], |
| 85 | [ |
| 86 | 'inline-import', |
| 87 | { |
| 88 | extensions: ['.css'], |
| 89 | }, |
| 90 | ], |
| 91 | ]; |
| 92 | } |
| 93 | |
| 94 | if (isTest) { |
| 95 | return [ |
| 96 | ...defaultPlugins, |
| 97 | [ |
| 98 | 'inline-react-svg', |
| 99 | { |
| 100 | svgo, |
| 101 | }, |
| 102 | ], |
| 103 | ]; |
| 104 | } |
| 105 | |
| 106 | if (!isProduction) { |
| 107 | return [...defaultPlugins]; |
| 108 | } |
| 109 | |
| 110 | return defaultPlugins; |
| 111 | } |
| 112 | |
| 113 | module.exports = { |
| 114 | presets: presets(), |