Fix regression with webpack

Add some entries to `package.json` to improve compatibility with webpack

- Add `import` export as per webpack requirements
- Add `style` export for CSS file
- Add `*.css` to "side effects" to prevent issues with tree-shaking

With this commit, it is possible to import frappe-gantt without breaking
changes in webpack-based applications

Refs:
- https://webpack.js.org/guides/package-exports/

Close #439
This commit is contained in:
Geremia Taglialatela 2024-09-24 09:44:15 +02:00
parent 5bead3a4ff
commit c88e8fce11
No known key found for this signature in database
GPG Key ID: 4A6344430AD4E29F

View File

@ -26,7 +26,9 @@
],
"exports": {
".": {
"require": "./dist/frappe-gantt.umd.js"
"require": "./dist/frappe-gantt.umd.js",
"import": "./dist/frappe-gantt.es.js",
"style": "./dist/frappe-gantt.css"
}
},
"keywords": [
@ -55,5 +57,8 @@
"eslintIgnore": [
"dist"
],
"sideEffects": [
"*.css"
],
"packageManager": "yarn@1.22.22"
}