Skip to content

Commit 6cafcc0

Browse files
authored
fix: webpack browser build - use UMD dist/less.js, add CJS bundle (#4424)
* fix: webpack browser build - use UMD dist/less.js, add CJS bundle (#4423) - Browser exports point to dist/less.js (UMD) instead of less-node - Add CJS bundle (dist/less-node.cjs) for Node require() with module shim - Remove dead index.js; index.cjs re-exports CJS bundle - Add export tests: import-patterns, webpack-browser, test-cjs-suite - CI and publish workflows run test:node (build + CJS + ESM tests) * Beta publish script * chore: clarify test:node runs ESM + CJS in workflow labels * fix: normalize path separators in rollup plugin for Windows CI The inlinePackageVersion plugin used forward-slash path check that failed on Windows where rollup passes backslash-separated IDs, leaving the require('../../package.json') unresolved at runtime. * chore: bump version to 4.6.3 for release
1 parent 5b65bfc commit 6cafcc0

18 files changed

Lines changed: 1098 additions & 202 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ jobs:
4343
run: node --version && pnpm --version
4444
- name: Install chromium
4545
run: pnpm exec playwright install chromium
46-
- name: Run unit test
47-
run: pnpm run test
46+
- name: Run node tests (ESM + CJS)
47+
run: pnpm run test:node

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
- name: Install dependencies
4242
run: pnpm install --frozen-lockfile
4343

44-
- name: Run tests
45-
run: pnpm run test
44+
- name: Run node tests (ESM + CJS)
45+
run: pnpm run test:node
4646

4747
- name: Build
4848
run: |

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"name": "@less/root",
33
"private": true,
4-
"version": "4.6.0",
4+
"version": "4.6.3",
55
"description": "Less monorepo",
66
"homepage": "http://lesscss.org",
77
"scripts": {
88
"publish": "node scripts/bump-and-publish.js",
99
"publish:dry-run": "DRY_RUN=true node scripts/bump-and-publish.js",
10+
"publish:beta": "node scripts/publish-beta.js",
1011
"prepare": "husky",
1112
"changelog": "github-changes -o less -r less.js -a --only-pulls --use-commit-body -m \"(YYYY-MM-DD)\"",
1213
"test": "cd packages/less && npm test",
14+
"test:node": "cd packages/less && npm run test:node",
1315
"postinstall": "npx only-allow pnpm"
1416
},
1517
"author": "Alexis Sellier <self@cloudhead.net>",

0 commit comments

Comments
 (0)