diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index a9b11b8e..10f472a8 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -233,12 +233,20 @@ jobs: alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') echo "::set-output name=alias::${alias}" - # Create Universal Module Definition (UMD) bundle: - - name: 'Create Universal Module Definition (UMD) bundle' - id: umd-bundle + # Create Universal Module Definition (UMD) Node.js bundle: + - name: 'Create Universal Module Definition (UMD) Node.js bundle' + id: umd-bundle-node uses: stdlib-js/bundle-action@main with: - target: 'umd' + target: 'umd-node' + alias: ${{ steps.extract-alias.outputs.alias }} + + # Create Universal Module Definition (UMD) browser bundle: + - name: 'Create Universal Module Definition (UMD) browser bundle' + id: umd-bundle-browser + uses: stdlib-js/bundle-action@main + with: + target: 'umd-browser' alias: ${{ steps.extract-alias.outputs.alias }} # Rewrite file contents: @@ -254,19 +262,19 @@ jobs: find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/bundle.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n