Can Sencha Cmd be tuned for newer js features or replaced by other minifiers/optimizers? Or support coming with the latest versions anyway?
Asked
Active
Viewed 209 times
1 Answers
2
Since the version has not been clarified, I will describe for 4.2.6
- Go to root of your project and run
npm init
- Install babel:
npm install --save-dev babel-cli babel-preset-es2015
- Add to your
package.json
run scripts:
"scripts" : {
"build-prod": "./node_modules/.bin/babel es6 -d app --comments=false --compact=true",
"build-debug": "./node_modules/.bin/babel es6 -d app --sourceMaps=true",
"watch": "./node_modules/.bin/babel es6 -d app --watch"
},
- Move source code from
app
andapp.js
to another folder (for example call ites6
)
mv app.js app
mv app es6
- and create
build.xml
in root and paste new task into project tag:
<target name="-before-build">
<x-shell reloadprofile="true" dir="${basedir}">
npm run build-debug
</x-shell>
</target>

pvlt
- 1,843
- 1
- 10
- 19
-
The renaming part makes it a manual process, any way to fully automate? – Benjamin E. Jan 13 '20 at 11:38
-
I'm on Cmd 6.5.3 but could upgrade to anything newer – Benjamin E. Jan 13 '20 at 11:38
-
Why it's makes it process manual? But It doesn't matter, because version 6.5 support es6 from scratch https://www.sencha.com/blog/announcing-ext-js-6-5-and-sencha-cmd-6-5-ga/ https://www.sencha.com/blog/getting-started-with-es2015-using-sencha-cmd-6-5/ – pvlt Jan 13 '20 at 12:10
-
1Not object destructuring, which is a bummer since it's a nice js enhancement :) – Benjamin E. Jan 14 '20 at 02:15
-
Got it, i agree it's good feature. Then return to my question. Why renaming part makes it process manual? We just create new source folder for babel, old folder (app) is a destination. In the same time old folder (app) is source folder for Sencha CMD. So we get automate pipeline. P.S. In my manual one step was unnecessary – pvlt Jan 14 '20 at 07:59