preact-router
preact-router copied to clipboard
Not able to build on Windows
Variable names in the script is preventing build on windows.
> uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map
fs.js:557
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'C:\...\Forks\preact-router\${npm_package_main}.map'
at Object.fs.openSync (fs.js:557:18)
at Object.fs.readFileSync (fs.js:467:33)
at Object.<anonymous> (C:\...\Forks\preact-router\node_modules\uglify-js\bin\uglifyjs:285:30)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.runMain (module.js:607:10)
at run (bootstrap_node.js:382:7)
related: #49
Yes, this is a known issue, if you are on windows 10 you can try bash for windows
(but that crashes when you run the tests)
Looking to switch to jsdom + node for the tests (likely via Jest) to fix this.
yeah, the problem is that npm always uses cmd on windows to run the commands and the syntax for the variables would be different
There's a module called cross-var
that can help with that
nvm, I'm stupid, I was thinking of cross-env, sorry
but stuff like $(gzip-size $npm_package_minified_main)
still won't work, which is sad
@developit thoughts on a separate task runner like gulp or start-runner (it has suport for rollup and uglify)
I'm not big on them. Rollup already supports 90% of what is needed here - for example, it can output gzipped bundle size. I'm just not using it properly :P