-
Notifications
You must be signed in to change notification settings - Fork 25
/
esbuild.cjs
31 lines (26 loc) · 1020 Bytes
/
esbuild.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const esbuild = require('esbuild');
const generalConfig = { minify: true, bundle: true, write: true }
const sdkClientConfig = esbuild.build(
Object.assign({}, generalConfig, {
entryPoints: ['packages/sdk-client/src/index.ts'],
globalName: 'window["@commercetools/sdk-client-v2"]',
outfile: 'packages/sdk-client/dist/commercetools-sdk-client-v2.umd.js'
})
)
const sdkClientV3Config = esbuild.build(
Object.assign({}, generalConfig, {
entryPoints: ['packages/sdk-client-v3/src/index.ts'],
globalName: 'window["@commercetools/ts-client"]',
outfile: 'packages/sdk-client-v3/dist/commercetools-ts-client.umd.js'
})
)
const platformSdkConfig = esbuild.build(
Object.assign({}, generalConfig, {
entryPoints: ['packages/platform-sdk/src/index.ts'],
globalName: 'window["@commercetools/platform-sdk"]',
outfile: 'packages/platform-sdk/dist/commercetools-platform-sdk.umd.js',
})
)
Promise.all([
sdkClientConfig, sdkClientV3Config, platformSdkConfig
]).catch(console.error);