diff --git a/.circleci/config.yml b/.circleci/config.yml index 8299749cf..2479ea484 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ jobs: - restore_cache: *restore_yarn_cache_node_16 - run: name: Installing dependencies - command: yarn install --frozen-lockfile + command: yarn install --ignore-engines --frozen-lockfile # temp ignore engine checks [will deprecate node v16 soon] - save_cache: *save_yarn_cache_node_16 - run: name: Install example dependencies diff --git a/.nvmrc b/.nvmrc index 805efa9f6..645ae0c87 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.14.0 \ No newline at end of file +20.15.0 \ No newline at end of file diff --git a/esbuild.cjs b/esbuild.cjs new file mode 100644 index 000000000..e1b5c02b3 --- /dev/null +++ b/esbuild.cjs @@ -0,0 +1,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); diff --git a/examples/browser/browser.html b/examples/browser/browser.html index e0c5a88ce..31ba3b218 100644 --- a/examples/browser/browser.html +++ b/examples/browser/browser.html @@ -14,10 +14,12 @@ -
++ +