Packaging app with enyo 2.0b3

edited April 2012 in Packaging Apps
Hi Enyo croud,

maybe I'm just to blind to see the obvious, but I'm unable to package my small app, together with enyo, using the supplied script. From the example "3 Making Builds", I figured out that in order to package the enyo sources together with the app's sources, you need to add "$enyo/source" to the depencency list.
The created .js file fails when executed in the browser, though, with: "enyo is not defined".
When taking a look at the generated build.js, this is no wonder, as the file starts with an enyo.path.addPaths call.
This can be disabled by adding -no-alias to the call to minify.js, but this will not solve the issue, as then enyo.logging =... is the first line executed, still without enyo being defined.

The workaround I found is to add "$enyo/source/boot/loader.js" at first position into the enyo.depends list.

If you can reproduce my findings, then minify.js should be updated to always include the boot/loader.js when creating a minified file including the enyo sources...

Furthermore, the build.css file is not loaded automatically and needs to be manually imported in the index.html file - this should be reflected in the example!

cu, mephinet


  • You should use the minify script thats in the enyo/source/minifier folder, not the one in tools. The in the source/minifier folder has the right settings to invoke the one in tools. You can also look at those to adapt if you want to package your app into the JS file.
  • Here's a simpler way that will be made into more official documentation later:

    Make a folder called "minify" next to your source folder. In that make the following files:

    Github Gist

    This will use the package.js file in source/ of your app folder and compress everything all into build/app.js and build/app.css.

    One caveat: You must fix up the path in to point to your checkout of enyo. (sorry, paths are hard).
  • Perfect, guys, thanks a lot!
Sign In or Register to comment.