From c88e8fce113412efdb58dd72e34febc5ed47b17b Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Tue, 24 Sep 2024 09:44:15 +0200 Subject: [PATCH] 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 --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3baa1e9a..94e0ca81 100755 --- a/package.json +++ b/package.json @@ -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" }