Closed simast closed 9 years ago
I have just added new example for you how to use "scripts" from config. https://github.com/igorklopov/enclose/tree/master/examples/31-scripts - Please look through it. In your case you should add ../some/path/test
to "scripts". Or even ../some/path/**/*.js
The docs are lacking indeed - i will finish them soon.
Thank you for the example, however, I did forget to mention that the scripts I am trying to include are actually .json
and not .js
files. Node.js require
supports loading JSON files, but with the scripts directive I get the following error during the compilation process:
{ stage: 'parsing source file',
file: '/path/to/some.json',
directory: '/path/to' }
undefined:0
Please update to recent enclose 0.0.17. It seems to gather JSON files properly.
I had a look at the latest version and noticed another issue with paths that have relative ..
directories. Please see this example project where the data.json
file is not resolved:
https://drive.google.com/file/d/0B-ZXYfeVKweHUGdIek1QdW5Fcms/view?usp=sharing
Run npm install
and then node compile.js
.
I fixed your dataPath
bug. Please update to enclose@0.2.1 and try again
It works now - thanks! Although I spotted another minor issue with argv - will open a new bug for this. Thanks for the fix.
It seems
require(...)
calls that don't use simple strings as a module path are not resolved (and not included in the generated binary).Example:
Will throw an unhandled path not found exception. Is there any known workaround for including dependencies that cannot be referenced with plain strings? Could I use the
--config
option andscripts
callback as a workaround? The docs are a bit lacking on the config option right now, not sure how to approach this.