mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 22:06:37 +02:00
🎉 Integrate exporter with svgclean.
This commit is contained in:
parent
70d464189f
commit
f66ddcaa2d
8 changed files with 165 additions and 75 deletions
File diff suppressed because one or more lines are too long
|
@ -69,9 +69,12 @@
|
||||||
(defn- do-svg-clean
|
(defn- do-svg-clean
|
||||||
[ctx data]
|
[ctx data]
|
||||||
(let [res (promise)
|
(let [res (promise)
|
||||||
cleaner (->> (graal/source "js" "require('svgclean')")
|
bindings (graal/get-bindings ctx "js")
|
||||||
(graal/eval! ctx))
|
optimize (-> (graal/get-bindings ctx "js")
|
||||||
resultp (graal/invoke-member cleaner "optimize" data)]
|
(graal/get-member "svgc")
|
||||||
|
(graal/get-member "optimize"))
|
||||||
|
resultp (graal/invoke optimize data)]
|
||||||
|
|
||||||
(graal/invoke-member resultp "then"
|
(graal/invoke-member resultp "then"
|
||||||
(reify Consumer
|
(reify Consumer
|
||||||
(accept [_ val]
|
(accept [_ val]
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
(.eval ^Context ctx ^Source source))
|
(.eval ^Context ctx ^Source source))
|
||||||
|
|
||||||
(defn ^Value get-bindings
|
(defn ^Value get-bindings
|
||||||
[ctx]
|
[ctx lang]
|
||||||
(.getBindings ^Context ctx))
|
(.getBindings ^Context ctx ^String lang))
|
||||||
|
|
||||||
(defn ^Value get-member
|
(defn ^Value get-member
|
||||||
[vobj name]
|
[vobj name]
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.pages :as cp]
|
[app.common.pages :as cp]
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
|
["./svgclean" :as svgc]
|
||||||
["xml-js" :as xml]
|
["xml-js" :as xml]
|
||||||
["child_process" :as chp]
|
["child_process" :as chp]
|
||||||
["os" :as os]
|
["os" :as os]
|
||||||
|
@ -114,17 +115,16 @@
|
||||||
(-> (write-file! pbmpath stdout)
|
(-> (write-file! pbmpath stdout)
|
||||||
(p/then (constantly pbmpath)))))
|
(p/then (constantly pbmpath)))))
|
||||||
(p/then trace-color-mask)
|
(p/then trace-color-mask)
|
||||||
|
(p/then read-file)
|
||||||
(p/then clean-svg)
|
(p/then clean-svg)
|
||||||
(p/then (fn [svgpath]
|
(p/then (fn [data]
|
||||||
(p/let [data (read-file svgpath)
|
(p/let [data (parse-xml data)
|
||||||
data (parse-xml data)
|
|
||||||
data (get-in data ["elements" 0])]
|
data (get-in data ["elements" 0])]
|
||||||
{:svgpath svgpath
|
{:color color
|
||||||
:color color
|
|
||||||
:svgdata data}))))))
|
:svgdata data}))))))
|
||||||
|
|
||||||
(join-color-layers [layers]
|
(join-color-layers [layers]
|
||||||
(log/info :fn :join-color-layers :layers (map :svgpath layers))
|
(log/info :fn :join-color-layers)
|
||||||
(loop [main (-> (:svgdata (first layers))
|
(loop [main (-> (:svgdata (first layers))
|
||||||
(assoc "elements" []))
|
(assoc "elements" []))
|
||||||
layers (seq layers)]
|
layers (seq layers)]
|
||||||
|
@ -142,13 +142,9 @@
|
||||||
(-> (p/all (map (partial generate-color-mask ppmpath) colors))
|
(-> (p/all (map (partial generate-color-mask ppmpath) colors))
|
||||||
(p/then join-color-layers)))
|
(p/then join-color-layers)))
|
||||||
|
|
||||||
(clean-svg [svgpath]
|
(clean-svg [data]
|
||||||
(log/info :fn :clean-svg :svgpath svgpath)
|
(log/info :fn :clean-svg)
|
||||||
(let [basepath (path/dirname svgpath)
|
(svgc/optimize data))
|
||||||
basename (path/basename svgpath ".svg")
|
|
||||||
svgpath' (path/join basepath (str basename "-optimized.svg"))]
|
|
||||||
(-> (run-cmd! (str "svgcleaner " svgpath " " svgpath'))
|
|
||||||
(p/then (constantly svgpath')))))
|
|
||||||
|
|
||||||
(trace-single-node [{:keys [data] :as node}]
|
(trace-single-node [{:keys [data] :as node}]
|
||||||
(log/info :fn :trace-single-node)
|
(log/info :fn :trace-single-node)
|
||||||
|
|
94
exporter/src/app/http/svgclean.js
Normal file
94
exporter/src/app/http/svgclean.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -11,9 +11,9 @@
|
||||||
regenerator-runtime "^0.13.4"
|
regenerator-runtime "^0.13.4"
|
||||||
|
|
||||||
"@types/node@*":
|
"@types/node@*":
|
||||||
version "14.14.14"
|
version "14.14.20"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340"
|
||||||
integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==
|
integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==
|
||||||
|
|
||||||
"@types/q@^1.5.1":
|
"@types/q@^1.5.1":
|
||||||
version "1.5.4"
|
version "1.5.4"
|
||||||
|
@ -241,12 +241,12 @@ cache-content-type@^1.0.0:
|
||||||
ylru "^1.2.0"
|
ylru "^1.2.0"
|
||||||
|
|
||||||
call-bind@^1.0.0:
|
call-bind@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce"
|
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
||||||
integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==
|
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
|
||||||
dependencies:
|
dependencies:
|
||||||
function-bind "^1.1.1"
|
function-bind "^1.1.1"
|
||||||
get-intrinsic "^1.0.0"
|
get-intrinsic "^1.0.2"
|
||||||
|
|
||||||
chalk@^2.4.1:
|
chalk@^2.4.1:
|
||||||
version "2.4.2"
|
version "2.4.2"
|
||||||
|
@ -332,9 +332,9 @@ cookies@~0.8.0:
|
||||||
keygrip "~1.1.0"
|
keygrip "~1.1.0"
|
||||||
|
|
||||||
core-js-pure@^3.0.0:
|
core-js-pure@^3.0.0:
|
||||||
version "3.8.1"
|
version "3.8.2"
|
||||||
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.8.1.tgz#23f84048f366fdfcf52d3fd1c68fec349177d119"
|
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.8.2.tgz#286f885c0dac1cdcd6d78397392abc25ddeca225"
|
||||||
integrity sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g==
|
integrity sha512-v6zfIQqL/pzTVAbZvYUozsxNfxcFb6Ks3ZfEbuneJl3FW9Jb8F6vLWB6f+qTmAu72msUdyb84V8d/yBFf7FNnw==
|
||||||
|
|
||||||
core-util-is@~1.0.0:
|
core-util-is@~1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
|
@ -463,16 +463,16 @@ delegates@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||||
|
|
||||||
depd@^1.1.2, depd@~1.1.2:
|
depd@^2.0.0, depd@~2.0.0:
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
|
|
||||||
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
|
|
||||||
|
|
||||||
depd@~2.0.0:
|
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
|
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
|
||||||
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
|
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
|
||||||
|
|
||||||
|
depd@~1.1.2:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
|
||||||
|
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
|
||||||
|
|
||||||
des.js@^1.0.0:
|
des.js@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843"
|
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843"
|
||||||
|
@ -684,7 +684,7 @@ function-bind@^1.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||||
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
||||||
|
|
||||||
get-intrinsic@^1.0.0:
|
get-intrinsic@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49"
|
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49"
|
||||||
integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==
|
integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==
|
||||||
|
@ -933,9 +933,9 @@ koa-convert@^1.2.0:
|
||||||
koa-compose "^3.0.0"
|
koa-compose "^3.0.0"
|
||||||
|
|
||||||
koa@^2.13.0:
|
koa@^2.13.0:
|
||||||
version "2.13.0"
|
version "2.13.1"
|
||||||
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501"
|
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.1.tgz#6275172875b27bcfe1d454356a5b6b9f5a9b1051"
|
||||||
integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==
|
integrity sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w==
|
||||||
dependencies:
|
dependencies:
|
||||||
accepts "^1.3.5"
|
accepts "^1.3.5"
|
||||||
cache-content-type "^1.0.0"
|
cache-content-type "^1.0.0"
|
||||||
|
@ -944,7 +944,7 @@ koa@^2.13.0:
|
||||||
cookies "~0.8.0"
|
cookies "~0.8.0"
|
||||||
debug "~3.1.0"
|
debug "~3.1.0"
|
||||||
delegates "^1.0.0"
|
delegates "^1.0.0"
|
||||||
depd "^1.1.2"
|
depd "^2.0.0"
|
||||||
destroy "^1.0.4"
|
destroy "^1.0.4"
|
||||||
encodeurl "^1.0.2"
|
encodeurl "^1.0.2"
|
||||||
escape-html "^1.0.3"
|
escape-html "^1.0.3"
|
||||||
|
@ -1007,17 +1007,17 @@ miller-rabin@^4.0.0:
|
||||||
bn.js "^4.0.0"
|
bn.js "^4.0.0"
|
||||||
brorand "^1.0.1"
|
brorand "^1.0.1"
|
||||||
|
|
||||||
mime-db@1.44.0:
|
mime-db@1.45.0:
|
||||||
version "1.44.0"
|
version "1.45.0"
|
||||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92"
|
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea"
|
||||||
integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==
|
integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==
|
||||||
|
|
||||||
mime-types@^2.1.18, mime-types@~2.1.24:
|
mime-types@^2.1.18, mime-types@~2.1.24:
|
||||||
version "2.1.27"
|
version "2.1.28"
|
||||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f"
|
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd"
|
||||||
integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==
|
integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
mime-db "1.44.0"
|
mime-db "1.45.0"
|
||||||
|
|
||||||
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
|
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
|
@ -1471,9 +1471,9 @@ shadow-cljs-jar@1.3.2:
|
||||||
integrity sha512-XmeffAZHv8z7451kzeq9oKh8fh278Ak+UIOGGrapyqrFBB773xN8vMQ3O7J7TYLnb9BUwcqadKkmgaq7q6fhZg==
|
integrity sha512-XmeffAZHv8z7451kzeq9oKh8fh278Ak+UIOGGrapyqrFBB773xN8vMQ3O7J7TYLnb9BUwcqadKkmgaq7q6fhZg==
|
||||||
|
|
||||||
shadow-cljs@^2.11.8:
|
shadow-cljs@^2.11.8:
|
||||||
version "2.11.10"
|
version "2.11.13"
|
||||||
resolved "https://registry.yarnpkg.com/shadow-cljs/-/shadow-cljs-2.11.10.tgz#0d55263a5ad31cac48d07fe9c719821122ec969d"
|
resolved "https://registry.yarnpkg.com/shadow-cljs/-/shadow-cljs-2.11.13.tgz#ac229923bd2cb7f69e816ecd856b2250d4acfff3"
|
||||||
integrity sha512-/QbBjT75Dn+SY5C7ntu0VSYrId9Jj2EjncxpnB9E9OJn7mpdbmK3zs+PIC/6gpPdBr4gUhfagauD6AJEmsI6xg==
|
integrity sha512-igdiPxa9zx5sp66O/zD3SygL2SNobZUKjF74x+eVDfmRue4dudtqtAthMZwnB82SFx1Xh9LpmQGDK+45RvFhZQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
node-libs-browser "^2.2.1"
|
node-libs-browser "^2.2.1"
|
||||||
readline-sync "^1.4.7"
|
readline-sync "^1.4.7"
|
||||||
|
@ -1608,9 +1608,9 @@ tar-fs@^2.0.0:
|
||||||
tar-stream "^2.1.4"
|
tar-stream "^2.1.4"
|
||||||
|
|
||||||
tar-stream@^2.1.4:
|
tar-stream@^2.1.4:
|
||||||
version "2.1.4"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.4.tgz#c4fb1a11eb0da29b893a5b25476397ba2d053bfa"
|
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
|
||||||
integrity sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==
|
integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
bl "^4.0.3"
|
bl "^4.0.3"
|
||||||
end-of-stream "^1.4.1"
|
end-of-stream "^1.4.1"
|
||||||
|
@ -1750,9 +1750,9 @@ ws@^3.0.0:
|
||||||
ultron "~1.1.0"
|
ultron "~1.1.0"
|
||||||
|
|
||||||
ws@^7.2.3:
|
ws@^7.2.3:
|
||||||
version "7.4.1"
|
version "7.4.2"
|
||||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb"
|
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.2.tgz#782100048e54eb36fe9843363ab1c68672b261dd"
|
||||||
integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ==
|
integrity sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==
|
||||||
|
|
||||||
xml-js@^1.6.11:
|
xml-js@^1.6.11:
|
||||||
version "1.6.11"
|
version "1.6.11"
|
||||||
|
|
8
vendor/svgclean/main.js
vendored
8
vendor/svgclean/main.js
vendored
|
@ -1,16 +1,13 @@
|
||||||
const plugins = [
|
const plugins = [
|
||||||
{removeDimensions: true},
|
{removeDimensions: true},
|
||||||
// {removeXMLNS: false},
|
|
||||||
{removeScriptElement: true},
|
{removeScriptElement: true},
|
||||||
{removeViewBox: false},
|
{removeViewBox: false},
|
||||||
{moveElemsAttrsToGroup: false},
|
{moveElemsAttrsToGroup: false},
|
||||||
{
|
{convertPathData: {
|
||||||
convertPathData: {
|
|
||||||
lineShorthands: false,
|
lineShorthands: false,
|
||||||
curveSmoothShorthands: false,
|
curveSmoothShorthands: false,
|
||||||
forceAbsolutePath: true,
|
forceAbsolutePath: true,
|
||||||
},
|
}}
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const svgc = require("./src/svgclean.js");
|
const svgc = require("./src/svgclean.js");
|
||||||
|
@ -20,4 +17,3 @@ exports.optimize = function(data) {
|
||||||
return svgc.optimize(inst, data)
|
return svgc.optimize(inst, data)
|
||||||
.then((result) => result.data);
|
.then((result) => result.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
5
vendor/svgclean/package.json
vendored
5
vendor/svgclean/package.json
vendored
|
@ -6,9 +6,10 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "set NODE_ENV=test && mocha",
|
"test": "set NODE_ENV=test && mocha",
|
||||||
"lint": "jshint --show-non-errors .",
|
"lint": "jshint --show-non-errors .",
|
||||||
"build": "browserify -r./main.js:svgclean -o bundle.js",
|
"build": "browserify -s svgc main.js -o bundle.js",
|
||||||
"minify": "terser bundle.js -c -m -o bundle.min.js",
|
"minify": "terser bundle.js -c -m -o bundle.min.js",
|
||||||
"dist": "npm run build && npm run minify"
|
"copy": "cp ./bundle.min.js ../../backend/resources/svgclean.js && cp ./bundle.min.js ../../exporter/src/app/http/svgclean.js",
|
||||||
|
"dist": "npm run build && npm run minify && npm run copy"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue