Skip to content

Commit

Permalink
add prefix and extra assets from wormhole connect (#668)
Browse files Browse the repository at this point in the history
* add prefix and extra assets from wormhole connect

* fix build, update connect command to add deployment path

* fix sed command

* add wild cards to viteStaticCopy plugin
  • Loading branch information
sebastianscatularo authored Jan 12, 2024
1 parent e14bda5 commit 8a8be85
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ jobs:
npm install -g husky
pushd wormhole-connect
npm ci --workspaces --if-present
sed -i -e 's|vite build",|vite build --base=${{inputs.public-url}}/assets/wormhole-connect/",|g' wormhole-connect/package.json
npm run build
echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
Expand Down Expand Up @@ -264,6 +265,7 @@ jobs:
npm install -g husky
pushd wormhole-connect
npm ci --workspaces --if-present
sed -i -e 's|vite build",|vite build --base=${{inputs.public-url}}/assets/wormhole-connect/",|g' wormhole-connect/package.json
npm run build
echo "_JS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.js | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
echo "_CSS_SHA_384=$(shasum -b -a 384 wormhole-connect-loader/dist/main.css | awk '{ print $1 }' | xxd -r -p | base64)" >> "${GITHUB_OUTPUT}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
name: testnet
separator: T
connect-branch: portal-bridge
connect-branch: development
advanced-tools-branch: advanced-tools
environment: Cloudflare-Testnet
public-url: "/${{ needs.branch-sha.outputs.value }}"
Expand Down
22 changes: 21 additions & 1 deletion apps/connect/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const MAINNET_RPCS = {
// https://vitejs.dev/config/
export default defineConfig({
base: process.env.PUBLIC_URL || '',
build: {
rollupOptions: {
output: {
entryFileNames: 'pb-[name].js',
assetFileNames: 'pb-[name]-[hash][extname]',
},
},
},
define: {
redirects: {},
wormholeConnectConfig: {
Expand All @@ -39,8 +47,20 @@ export default defineConfig({
viteStaticCopy({
targets: [
{
src: 'node_modules/@wormhole-foundation/wormhole-connect/dist/*',
src: 'node_modules/@wormhole-foundation/wormhole-connect/dist/*.js',
dest: 'assets/wormhole-connect/'
},
{
src: 'node_modules/@wormhole-foundation/wormhole-connect/dist/*.css',
dest: 'assets/wormhole-connect/'
},
{
src: 'node_modules/@wormhole-foundation/wormhole-connect/dist/assets/*.js',
dest: 'assets/wormhole-connect/assets'
},
{
src: 'node_modules/@wormhole-foundation/wormhole-connect/dist/assets/*.css',
dest: 'assets/wormhole-connect/assets'
}
]
})
Expand Down

0 comments on commit 8a8be85

Please sign in to comment.