diff --git a/package.json b/package.json
index 62aa34c72f3a307d800118b0c54b1325746166f3..7fa2434be4b6c9c9e90c4cbfca9022089eacf57e 100644
--- a/package.json
+++ b/package.json
@@ -23,6 +23,7 @@
   },
   "scripts": {
     "prepublish": "tsc",
+    "prepack": "find -name \"*.ts\" | grep -v \".d.ts\" | xargs rm",
     "tsc": "tsc",
     "tscw": "tsc -w",
     "doc": "typedoc --out typedoc/ index.ts app/ --mode file --readme README.md --includeDeclarations --sourcefile-url-prefix \"https://git.duniter.org/nodes/typescript/duniter/blob/loki/\"",