Skip to content

fix: Publish destination and build script on Windows#1593

Closed
alexanderroidl wants to merge 2 commits intofb55:masterfrom
alexanderroidl:fix/publish-dist-and-build-script
Closed

fix: Publish destination and build script on Windows#1593
alexanderroidl wants to merge 2 commits intofb55:masterfrom
alexanderroidl:fix/publish-dist-and-build-script

Conversation

@alexanderroidl
Copy link
Copy Markdown

The recently commited commit 9421ec9 lead to the lib directory not being part of the published package anymore, which results in required files not being found and eventually failure.

For example when building an Angular application:

$ npm run build

> myangularproject@0.0.1 build
> ng build

An unhandled exception occurred: Cannot find module './compile.js'
Require stack:
- C:\Users\alex\Projekte\myangularproject\node_modules\css-select\lib\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\beasties\dist\index.cjs
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\utils\index-file\inline-critical-css.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\utils\index-file\index-html-generator.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\tools\esbuild\index-html-generator.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\execute-post-bundle.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\execute-build.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\private.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular-devkit\build-angular\src\builders\browser\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
See "C:\Users\alex\AppData\Local\Temp\ng-vsSuqp\angular-errors.log" for further details

A dist directory appears to be used to publish:

9421ec9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R26

But it can not be found in any shape or form inside the repository. There is no reference to such a directory in any file. Is there a build script which has not been pushed yet that fails to export the missing files perhaps?

Comment thread package.json
},
"files": [
"dist",
"src"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deliver the source code to users Git/GitHub should be used. The source files should not exported for a NPM publish.

Comment thread package.json
"import": "./lib/esm/index.js"
},
"files": [
"dist",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dist directory does not exist and can not be built right now as there is no build script for it.

Comment thread package.json
"format:prettier": "npm run prettier -- --write",
"prettier": "prettier '**/*.{ts,md,json,yml}'",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/css-select/$(git rev-parse HEAD)/src/",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL needs to be wrapped in quotation marks to function in Windows+Git Bash.

@fb55
Copy link
Copy Markdown
Owner

fb55 commented Mar 20, 2026

@alexanderroidl thanks for the PR, and sorry for not getting to it!

Switched back to dist in #1746 and dropped the script, which should fix this!

@fb55 fb55 closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants