Skip to content

Commit

Permalink
Separate browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapillon committed Nov 9, 2023
1 parent db1ad48 commit a93c66c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Deploy
- name: Publish browser build
run: |
aws s3 cp --acl=public-read dist/main.js s3://$S3_BUCKET/js/schematic.js
aws s3 cp --acl=public-read dist/main.js s3://$S3_BUCKET/js/schematic.${{ steps.package.outputs.version }}.js
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"dependencies": {
"@types/pako": "^2.0.0",
"@types/uuid": "^9.0.2",
"uuid": "^9.0.0"
},
Expand All @@ -13,11 +12,11 @@
"modules": false,
"name": "schematic-js",
"scripts": {
"build": "parcel build src/main.ts --public-url ./ --detailed-report",
"build": "parcel build src/browser.ts --public-url ./ --detailed-report",
"clean": "rm -rf dist && rm -rf .parcel-cache",
"watch": "parcel watch src/main.ts --public-url ./"
"watch": "parcel watch src/browser.ts --public-url ./"
},
"source": "src/main.ts",
"source": "src/browser.ts",
"targets": {
"default": {
"isLibrary": false,
Expand Down
3 changes: 3 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Schematic } from "./main";

(window as any).Schematic = Schematic;
4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type FlagCheckContext = {
};

/* @preserve */
class Schematic {
export class Schematic {
private apiKey: string;
private eventQueue: Event[];

Expand Down Expand Up @@ -172,5 +172,3 @@ class Schematic {
}
}
}

(window as any).Schematic = Schematic;

0 comments on commit a93c66c

Please sign in to comment.