enyo pack does not respect package.json

I was following the tutorial here:
http://enyojs.com/docs/latest/developer-guide/getting-started/creating-and-building-an-app.html

This code generates a 'build' folder:

enyo pack --production -d ./build --no-inline-css --css-outfile app.css --no-inline-js --js-outfile app.'s

And the contents are three files:
app.css
app.js
index.html

However modifying the package.json to be:

{
"name": "my-project",
"main": "index.js",
"assets": [
"assets/icon.png"
],
"styles": [
"src/app.less"
],
"production": true,
"outDir": "./build",
"inlineCss": false,
"outCssFile": "app.css",
"inlineJs": false,
"outJsFile": "app.js"
}

and issuing

enyo pack

still generates the default 'dist' folder with 6 files in it
enyo.css
enjo.js
enyo.js.map
index.html
my-project.js
my-project.js.map

I am perplexed. I thought the package.json file was supposed to direct the build process?

Mac OS 10.9.5
Latest install of enyo 2.7
with installation of pug and jstransformer (since jade and transformer were reported deprecated and I was instructed to add these two libraries in the installation process.

Comments

  • Something I've also noticed, if I change the .enyoconfig file, and change the

    "production": false,
    "devMode": true,

    to

    "production": true,
    "devMode": false,

    It seems to reduce the files produced even more, so the index.html contains all the javascript, which I like, but I would of expected the --production option detailed above to do the same thing.
  • The docs are wrong. :( We'll get a corrected version up on the site soon.
    "production": true,
    "outDir": "./build",
    "inlineCss": false,
    "outCssFile": "app.css",
    "inlineJs": false,
    "outJsFile": "app.js"
    should all be in .enyoconfig, not package.json.

    The issue with --production vs. production: true seems strange. I thought they would do the same. Hopefully Jason can clarify this.
  • We've updated the doc source for this: https://github.com/enyojs/enyo-docs/pull/26

    Will try to kick off a build and update the online developer guide.
  • Hi,

    As Roy mentioned, the options should be in the project's .enyoconfig file. Options in commandline take priority, so you can override values in the .enyoconfig if desired.

    The production option as true will set devMode option to false. In production mode, no source-maps are generated, the js and css are minified, and both are inline in the html. Using the "inlineCss": false and "inlineJs": false can produce the single js/css minified blobs into external files.

    Just tested enyo pack --production against "production": true, "devMode": false in .enyocinfig with enyo pack and both produced identical output. Could you give any more details (or a link to a code repo) in regards to the discrepancy you saw?
Sign In or Register to comment.