Results 1 to 5 of 5

Thread: Build app wtih custom class as part of app.js bundle

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    46
    Answers
    1

    Default Answered: Build app wtih custom class as part of app.js bundle

    I currently have a standard MVC project that I can succesfully build. My question is, how can I include my own custom js files in the app.js minified file? i.e. I have a js file in a folder called app/class/customClass.js

    I've added this path + file to the app.json file but it doesn't bundle them. It includes them correctly, but it just puts them into the same path/file location in the build/production folder.

  2. If the root of your class name is the same as your application name then requiring it in anything but Ext.require will just work. If you use Ext.require in app.js to require it then you will need to setup a path for it.

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    If it's a Sencha Touch class (using Ext.define) then you just need to require the class.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    46
    Answers
    1

    Default

    I am defining it using Ext.define. Maybe the issue is I do not need to put the path/name in the app.json file. That may not be necessary since I'm requiring the class inside the app.

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    If the root of your class name is the same as your application name then requiring it in anything but Ext.require will just work. If you use Ext.require in app.js to require it then you will need to setup a path for it.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #5
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    46
    Answers
    1

    Default

    Thanks mitchell. Basically, I removed those entries from app.json and it bundled them in app.js. I didn't realize I didn't need to add a reference to them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •