> let luamin = require("luamin")
undefined
> var x = fs.readFileSync("test.lua", "utf8")
undefined
> x
'local a = 123'
> luamin.minify(x)
TypeError: Cannot read property 'value' of undefined
at unexpected (.\node_modules\luaparse\luaparse.js:499:55)
at lex (.\node_modules\luaparse\luaparse.js:627:12)
at end (.\node_modules\luaparse\luaparse.js:2092:17)
at parse (.\node_modules\luaparse\luaparse.js:2065:31)
at Object.minify (.\node_modules\luamin\luamin.js:621:6)
at repl:1:8
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
>
The file is encoded UTF8 with BOM. Changing it to UTF8 without BOM works. Maybe luamin could deal with it? BOMs are useful if all the environment deals with their existence.
Right out of my node console:
The file is encoded UTF8 with BOM. Changing it to UTF8 without BOM works. Maybe luamin could deal with it? BOMs are useful if all the environment deals with their existence.
Thanks.