diff --git a/.babelrc.esm-build b/.babelrc.esm-build deleted file mode 100644 index 413b47297..000000000 --- a/.babelrc.esm-build +++ /dev/null @@ -1,29 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "modules": false - } - ], - "@babel/react" - ], - "plugins": [ - [ - "formatjs", - { - "idInterpolationPattern": "[sha512:contenthash:base64:6]", - "ast": true - } - ], - [ - "module-resolver", - { - "root": ["./src"], - "alias": { - "": "./src" - } - } - ] - ] -} diff --git a/package.json b/package.json index 9389791aa..1d9991bb8 100644 --- a/package.json +++ b/package.json @@ -68,12 +68,9 @@ }, "scripts": { "start": "npm run build:design-tokens && vite", - "build": "node scripts/build.js && npm run build:esm", - "build:esm": "rimraf dist/esm && NODE_ENV=production babel --no-babelrc --config-file ./.babelrc.esm-build --ignore 'src/**/*.spec.js','src/**/fixtures/**','src/setupTests.js','src/reportWebVitals.js' src --out-dir dist/esm", - "build:vite": "BUILD_TARGET=umd vite build && BUILD_TARGET=esm vite build", + "build": "BUILD_TARGET=umd vite build && BUILD_TARGET=esm vite build", "test": "TZ=Europe/Amsterdam vitest", "test:storybook": "test-storybook --coverage", - "clean": "rimraf dist/*", "prepare-package": "node scripts/prepare-package.js", "makemessages-en": "formatjs extract 'src/**/*.{js,jsx}' --format scripts/i18n-formatter.js --out-file src/i18n/messages/en.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'", "makemessages-nl": "formatjs extract 'src/**/*.{js,jsx}' --format scripts/i18n-formatter.js --out-file src/i18n/messages/nl.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'", diff --git a/vite.config.mts b/vite.config.mts index 19bd9e828..ea9f06745 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -31,7 +31,7 @@ const buildTarget = process.env.BUILD_TARGET || 'umd'; * - the react-intl translations are not distributed yet (also broken in CRA/babel build!) */ const esmOutput = { - dir: 'dist-vite/esm', + dir: 'dist/esm', format: 'esm', preserveModules: true, preserveModulesRoot: 'src', @@ -51,7 +51,7 @@ const esmOutput = { * @todo - optimize with bundle splitting/chunk management. */ const umdOutput = { - dir: 'dist-vite', + dir: 'dist', format: 'umd', exports: 'named', name: 'OpenForms', @@ -91,7 +91,7 @@ export default defineConfig({ assetsInlineLimit: 8 * 1024, // 8 KiB cssCodeSplit: false, sourcemap: buildTarget !== 'esm', - outDir: 'dist-vite/umd', + outDir: 'dist/umd', rollupOptions: { input: 'src/sdk.jsx', // do not externalize anything in UMD build - bundle everything