i may need help with using uglify.js on what dce s...
# javascript
n
i may need help with using uglify.js on what dce spits out i am getting this error:
Copy code
Parse error at build/kotlin-js-min/client-js/main/d2v-chord-js.js.map:1,10
{"version":3,"file":"d2v-chord-js.js","sources":["../../../../../d2v-chord-commo
          ^
ERROR: Unexpected token: punc «:», expected: punc «;»
    at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:20:1), <anonymous>:71:23)
    at fatal (/usr/lib/node_modules/uglify-js/bin/uglifyjs:296:53)
    at run (/usr/lib/node_modules/uglify-js/bin/uglifyjs:240:9)
    at Object.<anonymous> (/usr/lib/node_modules/uglify-js/bin/uglifyjs:165:5)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
an i am not sure if thats a well known error or if i am calling uglifyjs completely wrong
g
It seems that uglify is trying to parse source map. You can have a look at one of data2viz example: https://github.com/data2viz/data2viz/blob/master/examples/ex-geo/ex-geo-js/webpack.config.js
n
so you do not invoke uglifyjs manually at all and webpack does that for you ?
g
Exactly
n
how do you invoke this?
i am guessing something like
npm pack
?
i am currently trying to get this to work with the kotlin frontend plugin
g
I don't use front-end plugin. I usually have yarn + webpack. I define the scripts in package.json and launch them directly or from gradle.