diff --git a/packages/rollup-package.config.mjs b/packages/rollup-package.config.mjs index a77082b33..5004ecf53 100644 --- a/packages/rollup-package.config.mjs +++ b/packages/rollup-package.config.mjs @@ -15,7 +15,12 @@ import importCss from 'rollup-plugin-import-css'; import properties from './uui-css/custom-properties.module.js'; // eslint-disable-line // @ts-ignore-end -const esbuidOptions = { minify: true }; +const tsconfigPath = new URL('../tsconfig.json', import.meta.url).pathname; + +/** + * @type {import('rollup-plugin-esbuild').Options} + */ +const esbuildOptions = { tsconfig: tsconfigPath, target: 'es2022' }; // TODO: We have to specify the 'target' manually here, because the tsconfig is not used correctly by rollup-plugin-esbuild const rootDir = new URL('../', import.meta.url).pathname; @@ -32,7 +37,7 @@ const createEsModulesConfig = (entryPoints = []) => { plugins: [ nodeResolve({ rootDir }), importCss({ from: undefined }), - esbuild(), + esbuild(esbuildOptions), processLitCSSPlugin(), ], }; @@ -84,7 +89,10 @@ const createBundleConfig = (bundle, namespace) => { importCss(), processLitCSSPlugin(), minifyHTML.default(), - esbuild(esbuidOptions), + esbuild({ + ...esbuildOptions, + minify: true, + }), ], } : undefined; diff --git a/tsconfig.json b/tsconfig.json index 0b02ed238..a6616e02c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "rootDirs": ["packages"], - "target": "esnext", + "target": "es2022", "module": "esnext", "noEmitOnError": true, - "lib": ["es2020", "dom", "dom.iterable"], + "lib": ["es2022", "dom", "dom.iterable"], "esModuleInterop": false, "declaration": true, "emitDeclarationOnly": true, diff --git a/turbo.json b/turbo.json index 185f00bbe..7dcf4eb0b 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,11 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["tsconfig.json", "package.json", "package-lock.json"], + "globalDependencies": [ + "tsconfig.json", + "package.json", + "package-lock.json", + "src/rollup-package.config.mjs" + ], "tasks": { "build": { "dependsOn": ["^build"],