Skip to content

Commit

Permalink
rooms: 使用Builder.settings.unpkgUrl 加载 emojibase-data
Browse files Browse the repository at this point in the history
  • Loading branch information
hotlong committed Jan 2, 2025
1 parent 8ddffcd commit 1897281
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion apps/storybook/components/AmisRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions packages/@steedos-widgets/liveblocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 5 additions & 10 deletions packages/@steedos-widgets/liveblocks/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
],
};
Expand Down Expand Up @@ -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([]),
},
],
},
Expand All @@ -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
});
}
}
],
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1897281

Please sign in to comment.