From ab6343a8dd409399dc74cb82e34bb69252b7fe88 Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Tue, 17 Sep 2024 16:07:02 -0400 Subject: [PATCH] chore(atomic-react): disable iife output https://coveord.atlassian.net/browse/KIT-3562 --- packages/atomic-react/rollup.config.mjs | 110 ++++++++++++------------ 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/packages/atomic-react/rollup.config.mjs b/packages/atomic-react/rollup.config.mjs index 0b5f047100a..2ecafadaa1f 100644 --- a/packages/atomic-react/rollup.config.mjs +++ b/packages/atomic-react/rollup.config.mjs @@ -2,20 +2,20 @@ import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; -import terser from '@rollup/plugin-terser'; +// import terser from '@rollup/plugin-terser'; import typescript from '@rollup/plugin-typescript'; import {defineConfig} from 'rollup'; import nodePolyfills from 'rollup-plugin-polyfill-node'; -/** @type {import("rollup").GlobalsOption} */ -const globals = { - react: 'React', - 'react-dom': 'ReactDOM', - 'react-dom/client': 'ReactDOM', - 'react-dom/server': 'ReactDOMServer', - '@coveo/atomic': 'CoveoAtomic', - '@coveo/headless': 'CoveoHeadless', -}; +// /** @type {import("rollup").GlobalsOption} */ +// const globals = { +// react: 'React', +// 'react-dom': 'ReactDOM', +// 'react-dom/client': 'ReactDOM', +// 'react-dom/server': 'ReactDOMServer', +// '@coveo/atomic': 'CoveoAtomic', +// '@coveo/headless': 'CoveoHeadless', +// }; /** @type {import('rollup').ExternalOption} */ const commonExternal = [ @@ -27,14 +27,14 @@ const commonExternal = [ '@coveo/headless', ]; -/** @returns {import('rollup').OutputOptions} */ -const outputIIFE = ({minify}) => ({ - file: `dist/iife/atomic-react${minify ? '.min' : ''}.js`, - format: 'iife', - name: 'CoveoAtomicReact', - globals, - plugins: minify ? [terser()] : [], -}); +// /** @returns {import('rollup').OutputOptions} */ +// const outputIIFE = ({minify}) => ({ +// file: `dist/iife/atomic-react${minify ? '.min' : ''}.js`, +// format: 'iife', +// name: 'CoveoAtomicReact', +// globals, +// plugins: minify ? [terser()] : [], +// }); /** @returns {import('rollup').OutputOptions} */ const outputCJS = ({useCase}) => ({ @@ -42,23 +42,23 @@ const outputCJS = ({useCase}) => ({ format: 'cjs', }); -/** @returns {import('rollup').OutputOptions} */ -const outputIIFERecs = ({minify}) => ({ - file: `dist/iife/atomic-react/recommendation${minify ? '.min' : ''}.js`, - format: 'iife', - name: 'CoveoAtomicReactRecommendation', - globals, - plugins: minify ? [terser()] : [], -}); +// /** @returns {import('rollup').OutputOptions} */ +// const outputIIFERecs = ({minify}) => ({ +// file: `dist/iife/atomic-react/recommendation${minify ? '.min' : ''}.js`, +// format: 'iife', +// name: 'CoveoAtomicReactRecommendation', +// globals, +// plugins: minify ? [terser()] : [], +// }); -/** @returns {import('rollup').OutputOptions} */ -const outputIIFECommerce = ({minify}) => ({ - file: `dist/iife/atomic-react/commerce${minify ? '.min' : ''}.js`, - format: 'iife', - name: 'CoveoAtomicReactCommerce', - globals, - plugins: minify ? [terser()] : [], -}); +// /** @returns {import('rollup').OutputOptions} */ +// const outputIIFECommerce = ({minify}) => ({ +// file: `dist/iife/atomic-react/commerce${minify ? '.min' : ''}.js`, +// format: 'iife', +// name: 'CoveoAtomicReactCommerce', +// globals, +// plugins: minify ? [terser()] : [], +// }); const plugins = [ json(), @@ -95,39 +95,39 @@ const pluginsCJS = [ ]; export default defineConfig([ - { - input: 'src/index.ts', - output: [outputIIFE({minify: true}), outputIIFE({minify: false})], - external: commonExternal, - plugins, - }, + // { + // input: 'src/index.ts', + // output: [outputIIFE({minify: true}), outputIIFE({minify: false})], + // external: commonExternal, + // plugins, + // }, { input: 'src/index.ts', output: [outputCJS({useCase: ''})], external: commonExternal, plugins: pluginsCJS, }, - { - input: 'src/recommendation.index.ts', - output: [outputIIFERecs({minify: true}), outputIIFERecs({minify: false})], - external: commonExternal, - plugins, - }, + // { + // input: 'src/recommendation.index.ts', + // output: [outputIIFERecs({minify: true}), outputIIFERecs({minify: false})], + // external: commonExternal, + // plugins, + // }, { input: 'src/recommendation.index.ts', output: [outputCJS({useCase: 'recommendation/'})], external: commonExternal, plugins: pluginsCJS, }, - { - input: 'src/commerce.index.ts', - output: [ - outputIIFECommerce({minify: true}), - outputIIFECommerce({minify: false}), - ], - external: commonExternal, - plugins, - }, + // { + // input: 'src/commerce.index.ts', + // output: [ + // outputIIFECommerce({minify: true}), + // outputIIFECommerce({minify: false}), + // ], + // external: commonExternal, + // plugins, + // }, { input: 'src/commerce.index.ts', output: [outputCJS({useCase: 'commerce/'})],