diff --git a/apps/storybook/components/AmisRender.tsx b/apps/storybook/components/AmisRender.tsx index c40174f8..f9b42c85 100644 --- a/apps/storybook/components/AmisRender.tsx +++ b/apps/storybook/components/AmisRender.tsx @@ -17,7 +17,8 @@ Builder.settings = { userId: localStorage.getItem('steedos:userId'), tenantId: localStorage.getItem('steedos:spaceId'), authToken: localStorage.getItem('steedos:authToken'), - } + }, + unpkgUrl: process.env.STEEDOS_UNPKG_URL, }; export { diff --git a/packages/@steedos-widgets/liveblocks/package.json b/packages/@steedos-widgets/liveblocks/package.json index bd2404c1..4a8058b9 100644 --- a/packages/@steedos-widgets/liveblocks/package.json +++ b/packages/@steedos-widgets/liveblocks/package.json @@ -54,6 +54,7 @@ "@liveblocks/react-ui": "2.12.0", "@rollup/plugin-replace": "^5.0.2", "@steedos-widgets/amis-lib": "6.3.12-beta.8", + "emojibase-data": "^16.0.2", "react-error-boundary": "^4.1.2" }, "gitHead": "ffb730e16642eb8e7a7ae5d98d0773c42482e7d2" diff --git a/packages/@steedos-widgets/liveblocks/rollup.config.ts b/packages/@steedos-widgets/liveblocks/rollup.config.ts index d95cd36b..f783422e 100644 --- a/packages/@steedos-widgets/liveblocks/rollup.config.ts +++ b/packages/@steedos-widgets/liveblocks/rollup.config.ts @@ -51,6 +51,10 @@ const options = { replace({ 'process.env.NODE_ENV': JSON.stringify('production'), }), + replace({ + preventAssignment: true, + 'https://cdn.jsdelivr.net/npm': '${Builder && Builder.settings && Builder.settings.unpkgUrl ? Builder.settings.unpkgUrl:"https://unpkg.com"}', + }) // terser() ], }; @@ -80,10 +84,7 @@ export default [ strict: false, intro: 'const global = window;', globals, - plugins: [getBabelOutputPlugin({ - allowAllFormats: true, - presets: [['@babel/preset-env', { modules: 'umd' }]], - })] + plugins: options.plugins.concat([]), }, ], }, @@ -104,12 +105,6 @@ export default [ fileName: 'assets.json', source: amis }); - const amisDev = JSON.stringify(assets, null, 4).replace(/\@\{\{version\}\}/g, ``).replace(/https\:\/\/unpkg.com/g, unpkgUrl) - this.emitFile({ - type: 'asset', - fileName: 'assets-dev.json', - source: amisDev - }); } } ], diff --git a/yarn.lock b/yarn.lock index 40f80d38..b8ca139a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10706,6 +10706,11 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== +emojibase-data@^16.0.2: + version "16.0.2" + resolved "https://registry.yarnpkg.com/emojibase-data/-/emojibase-data-16.0.2.tgz#eb832dc795c610164b1510dc5851e2ef5c416fe3" + integrity sha512-vRM82rvhjB4z5jDvxYanK/CZVe1QCu9ihxockyNvitd/aFkTT6Y4eeBW49GoXv5JMCNFrzDarADWrv7tjLcefA== + emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"