Skip to content

Commit c744ede

Browse files
committed
feat: no implicit lit
do not automatically import lit for esm, but instead defer it to the umd bundle
1 parent 81fade3 commit c744ede

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/rollup-package.config.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import properties from './uui-css/custom-properties.module.js'; // eslint-disabl
1515

1616
const esbuidOptions = { minify: true };
1717

18+
const rootDir = new URL('../', import.meta.url).pathname;
19+
1820
const createEsModulesConfig = (entryPoints = []) => {
1921
return [
2022
...entryPoints.map(name => {
@@ -26,7 +28,7 @@ const createEsModulesConfig = (entryPoints = []) => {
2628
},
2729
external: [/^lit/, /^@umbraco-ui/],
2830
plugins: [
29-
nodeResolve(),
31+
nodeResolve({ rootDir }),
3032
importCss({ from: undefined }),
3133
esbuild(),
3234
processLitCSSPlugin(),
@@ -63,15 +65,15 @@ const createBundleConfig = (bundle, namespace) => {
6365

6466
return bundle
6567
? {
66-
input: `lib/${bundle}.ts`,
68+
input: `lib/${bundle}.umd.ts`,
6769
output: {
6870
file: `./dist/${bundleName}.min.js`,
6971
format: 'umd',
7072
sourcemap: true,
7173
name: namespace,
7274
},
7375
plugins: [
74-
nodeResolve(),
76+
nodeResolve({ rootDir }),
7577
importCss(),
7678
processLitCSSPlugin(),
7779
minifyHTML.default(),

packages/uui-base/lib/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import 'lit';
2-
import 'lit/decorators.js';
3-
41
export * from './animations';
52
export * from './events';
63
export * from './mixins';

packages/uui/lib/index.umd.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import 'lit';
2+
import 'lit/decorators.js';
3+
import '.';

0 commit comments

Comments
 (0)