fix: use subdirectory for @excalidraw/excalidraw size limit (#6787)

* fix: use subdirectory for @excalidraw/excalidraw size limit

* fix

* update yml

* update path

* fix

* fix

* better
This commit is contained in:
Aakansha Doshi 2023-07-19 22:07:18 +05:30 committed by GitHub
parent 9fc15d81a0
commit 70888327a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 30 deletions

View File

@ -15,10 +15,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install
run: yarn --frozen-lockfile
- name: Install in src/packages/excalidraw
run: yarn --frozen-lockfile
working-directory: src/packages/excalidraw
env:
CI: true
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: size
build_script: build:umd
skip_step: install
directory: src/packages/excalidraw

View File

@ -145,15 +145,6 @@
"test:coverage": "react-scripts test --passWithNoTests --coverage --watchAll",
"autorelease": "node scripts/autorelease.js",
"prerelease": "node scripts/prerelease.js",
"release": "node scripts/release.js",
"size": "node scripts/buildPackageExcalidraw.js && size-limit"
},
"size-limit": [
{
"path": [
"src/packages/excalidraw/dist/excalidraw.development.js",
"src/packages/excalidraw/dist/excalidraw.production.min.js"
]
}
]
"release": "node scripts/release.js"
}
}

View File

@ -1,16 +0,0 @@
const { execSync } = require("child_process");
const excalidrawDir = `${__dirname}/../src/packages/excalidraw`;
const build = () => {
try {
execSync(`yarn --frozen-lockfile`);
execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir });
execSync(`yarn run build:umd`, { cwd: excalidrawDir });
} catch (err) {
console.error(err);
process.exit(1);
}
};
build();

View File

@ -80,6 +80,15 @@
"pack": "yarn build:umd && yarn pack",
"start": "webpack serve --config webpack.dev-server.config.js",
"install:deps": "yarn install --frozen-lockfile && yarn --cwd ../../../",
"build:example": "EXAMPLE=true webpack --config webpack.dev-server.config.js && yarn gen:types"
}
"build:example": "EXAMPLE=true webpack --config webpack.dev-server.config.js && yarn gen:types",
"size": "yarn build:umd && size-limit"
},
"size-limit": [
{
"path": "dist/excalidraw.development.js"
},
{
"path": "dist/excalidraw.production.min.js"
}
]
}