Skip to content

Commit 6a532c0

Browse files
committed
Add missing style export
Mimic FontAwesome's `package.json`. - Add `style` package export - Add `styles.scss` and `styles` exports - Add `styles.scss` to "side effects" to prevent issues with tree-shaking With this commit, it is possible to import the style with the following approaches: ```scss @import "choices.js"; @import "choices.js/styles"; @import "choices.js/styles.scss"; ``` Refs: - https://webpack.js.org/guides/package-exports/ - FortAwesome/Font-Awesome#18654 Close Choices-js#1184
1 parent 240f359 commit 6a532c0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
".": {
1313
"types": "./public/types/src/index.d.ts",
1414
"import": "./public/assets/scripts/choices.mjs",
15-
"require": "./public/assets/scripts/choices.js"
15+
"require": "./public/assets/scripts/choices.js",
16+
"style": "./src/styles/choices.scss"
1617
},
1718
"./search-basic": {
1819
"types": "./public/types/src/index.d.ts",
@@ -23,9 +24,13 @@
2324
"types": "./public/types/src/index.d.ts",
2425
"import": "./public/assets/scripts/choices.search-none.mjs",
2526
"require": "./public/assets/scripts/choices.search-none.min.js"
26-
}
27+
},
28+
"./styles": "./src/styles/choices.scss",
29+
"./styles.scss": "./src/styles/choices.scss"
2730
},
28-
"sideEffects": false,
31+
"sideEffects": [
32+
"./styles.scss"
33+
],
2934
"scripts": {
3035
"start": "run-p js:watch css:watch",
3136
"build": "run-p js:build css:build",

0 commit comments

Comments
 (0)