Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[colors] fix: output lib/cjs and lib/esm modules #6179

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
"name": "@blueprintjs/colors",
"version": "4.1.24",
"description": "Blueprint color definitions",
"main": "lib/index.js",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"esnext": "lib/esnext/index.js",
"typings": "lib/esm/index.d.ts",
"files": [
"lib",
"src"
],
"scripts": {
"clean": "rm -rf lib/*",
"compile": "run-p \"compile:*\"",
"compile:esm": "tsc -p src/",
"compile:esm": "tsc -p ./src",
"compile:cjs": "tsc -p ./src -m commonjs --outDir lib/cjs",
"compile:esnext": "tsc -p ./src -t esnext --outDir lib/esnext",
"compile:css": "sass-compile ./src",
"compile:css-colors": "generate-css-variables --retainDefault true --outputFileName colors _colors.scss",
"dev": "run-p \"compile:esm -- --watch\" \"compile:css -- --watch\"",
Expand Down
5 changes: 1 addition & 4 deletions packages/colors/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"extends": "../../../config/tsconfig.base",
"compilerOptions": {
"lib": ["es6", "dom"],
"module": "commonjs",
"outDir": "../lib",
"target": "ES2015"
Copy link
Contributor

@shim-flounce shim-flounce May 25, 2023

Choose a reason for hiding this comment

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

I believe this is caused by this. Instead of targeting ES2015, it now targets ES5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add in the tslib dependency. It's better for the packages to be consistent. We can consider migrating to "target": "es2015" in a future major version.

"outDir": "../lib/esm"
}
}