Comments (10)
I'm using cordova-uglify
with a webpack Angular2 project and it works fine except when UglifyJS2 mangles the component names in my project.. Using the following in my uglify-config.json
allows my uglified code to run:
"uglifyJsOptions": {
"mangle" :false,
},
Just thought I'd put this out there for people having the same issue.
from cordova-uglify.
Yes! This setting works with the default Ionic 2 seed.
from cordova-uglify.
Yeah I'm pretty sure I just need to update the default directory that is used to recursively search for .js
and .css
files. I don't think I'll need to update ng-annotate
and UglifyJS
.
from cordova-uglify.
Actually I should rephrase it, if you use ionic 2 with Angular 2. It will transpire all es6 files to one big es5 .js file regardless you use .js or.ts for your es6 script. And all the .sass files into one big .css file. All the .html files can be remain or in .js depends on if you use that htm like to js minifier or not.
from cordova-uglify.
I'm starting to learn Ionic 2, I plan on supporting it soon.
from cordova-uglify.
@apparition47 Thanks for the info I'll give it a try soon. Is this for an Ionic 2 project?
from cordova-uglify.
Looks like all that is needed to get cordova-uglify
working with Ionic 2 is to update the uglify-config.json
.
- Add
"build"
to the "foldersToProcess" array property inuglify-config.json
...
"foldersToProcess": [
"build"
],
...
- Add
"mangle": false
to the"uglifyJsOptions"
in theuglify-config.json
-
...
"uglifyJsOptions": {
"compress": {
"drop_console": true
},
"fromString": true,
"mangle" :false
},
...
I'm going to update the readme and add this info. Thanks @apparition47 @MrBokeh
from cordova-uglify.
@rossmartin I noticed you updated your README, but "mangle": true
there, which doesn't work for Angular 2 at the moment. Is that a mistake?
from cordova-uglify.
@apparition47 here is my settings which seems works well
"alwaysRun": true,
"recursiveFolderSearch": true,
"foldersToProcess": [
"js",
"css",
"img",
"build"
],
"uglifyJsOptions": {
"compress": {
"drop_console": true
},
"fromString": true,
"mangle" :false
},
from cordova-uglify.
@apparition47 Thanks I have a section that describes how to use it with Ionic 2 in the readme. Also in the configuration I note to set mangle
to false
to work with Ionic 2.
Thanks for the help.
from cordova-uglify.
Related Issues (20)
- How do I tell if this worked? HOT 11
- Latest Ionic 2 installation errors and warnings HOT 12
- Possible to specify when to run besides --release? HOT 4
- recursiveFolderSearch:true require foldersToProcess HOT 3
- js files have content undefined HOT 26
- files taken by Xcode are not from uglified files from platform/www HOT 1
- Possible improvements: save-license, do not uglify framework (, images) HOT 2
- Cannot find module '/usr/src/app/node_modules/uglify-es' HOT 6
- Why was image compression removed? HOT 1
- processFiles err: Error: ENOENT: no such file or directory HOT 2
- Solved issue with Cordova 7.0.* HOT 2
- New to uglify, a few questions please. HOT 1
- Error installing plugin, can't find plugin.xml HOT 7
- uglify JS files reduced to 'undefined' HOT 5
- Ionic 4? HOT 1
- Change from hooks to config.xml HOT 4
- Support ES6 HOT 3
- cordova build error HOT 1
- Cannot find plugin.xml for plugin "cordova-uglify"
- I offer help to improve and maintain this package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-uglify.