0

I am trying to minify sencha 5 project with sencha cmd, but it always failed.

sencha generate app -ext demoApp ./demoApp

Then I try to minify the app, by typing

sencha app build production

For blank project, the minify success, I can run in my local web server. Then I change the existing project that have been created, just add one button to display popup window (and the information displayed by xtype "displayfield").

Before it minified & after add one button to display popup, it works normal (tested in browser, click the button, the popup and information showed correctly). After minified, it doesn't work,

GET http://localhost/test/sencha/demoApp/widget/displayfield.js?_dc=1429726459576 404 not found.

"NetworkError: 404 Not Found - http://localhost/test/sencha/demoApp/widget/displayfield.js?_dc=1429726459576"

Is it weird? If I change the xtype "displayfield" to "textfield" it works normal, or if I change to "button" and change fieldLabel to text, it works!

Anyone have succesfull minify sencha 5 with sencha cmd? My Sencha Cmd version is 5.1.2.52 and I use sencha 5.1.0.107.

I attach the original app folder code original in here and my changes app code in here

Many thanks!

Jef
  • 869
  • 4
  • 13
  • 27

1 Answers1

0

Add into requires 'Ext.form.field.Display'

requires: [
   'demoApp.view.window.WindowViewController',
   'Ext.form.field.Display'
],
Simon Hoss
  • 562
  • 1
  • 3
  • 7
  • yeah it works, but can it be done without adding require to all files that needed (currently I have so many view, controller, model, etc), if I need to add one by one to all files, it is very irritating, because tested without minify it works normal... To me, can it be done with these ways? 1. just minify the js file without ext-all.js (this one will be included manual in html) 2. minify all the files, but include all required so doesnt need to declare in all sencha file what needs to be required. To me, the goals is how to minify and run well without add the requires. – Jef Apr 23 '15 at 02:48
  • 1. When you use sencha cmd it will minify the ext classes and yours in one file, but only the files needed in your application. 2. Normally you don't need to require extjs classes. It seems that this is a bug for the displayfield btw. you can add the require for this class into the Application. – Simon Hoss Apr 23 '15 at 05:29
  • Yah, its a bit different from sencha 4 minify... seems like I have to add in everything the needed class for the minify process – Jef Apr 23 '15 at 13:51
  • no you don't need to add everything normally it works out of the box. This is only a bug with Ext.form.field.Display – Simon Hoss Apr 24 '15 at 14:50
  • I think it is not just bug on Display, because test with label / other component it has same error, or maybe because label derive from Display? – Jef Apr 24 '15 at 18:35