Skip to content

Commit

Permalink
Fix regression with webpack
Browse files Browse the repository at this point in the history
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 frappe#439
  • Loading branch information
tagliala committed Sep 24, 2024
1 parent 5bead3a commit c88e8fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -55,5 +57,8 @@
"eslintIgnore": [
"dist"
],
"sideEffects": [
"*.css"
],
"packageManager": "[email protected]"
}

0 comments on commit c88e8fc

Please sign in to comment.