Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Oct 2, 2024
1 parent a50790e commit a1aeb81
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import { join } from 'path';
import { InterwebBuild, InterwebBuildOptions } from '@interweb/build';
import { join } from 'path';

interface BuildConfig {
entryFile: string;
outFile: string;
externalPackages: string[];
}

const configs: BuildConfig[] = [
{
entryFile: 'src/contract1/index.ts',
outFile: 'contracts/bundle1.js',
externalPackages: ['otherpackage', '~somepackage']
},
{
entryFile: 'src/contract2/index.ts',
outFile: 'contracts/bundle2.js',
externalPackages: ['differentpackage']
}
];

const rootDir = join(__dirname, '/../');

async function buildInterweb(config: BuildConfig): Promise<void> {
Expand All @@ -27,21 +40,7 @@ async function buildInterweb(config: BuildConfig): Promise<void> {
}
}

// Example usage
async function main() {
const configs: BuildConfig[] = [
{
entryFile: 'src/contract1/index.ts',
outFile: 'contracts/bundle1.js',
externalPackages: ['otherpackage', '~somepackage']
},
{
entryFile: 'src/contract2/index.ts',
outFile: 'contracts/bundle2.js',
externalPackages: ['differentpackage']
}
];

for (const config of configs) {
try {
await buildInterweb(config);
Expand Down

0 comments on commit a1aeb81

Please sign in to comment.