Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Minification is broken #483

Closed
e-oz opened this issue Nov 29, 2013 · 14 comments
Closed

Minification is broken #483

e-oz opened this issue Nov 29, 2013 · 14 comments

Comments

@e-oz
Copy link

e-oz commented Nov 29, 2013

updated generator-angular today and after grunt-build my code threw "Unknown provider: aProvider <- a" error.
I'm making this app as fast as possible, so I just wrapped all dependencies in [], but I wonder - if there is some new option in Gruntfile which I should turn on to get safe-minimized (for angular) js code?

@eddiemonge
Copy link
Member

There is the --minsafe flag which generates min safe files. Did you uncheck all the modules when setting up the project or did you leave them checked? What code did you add?

@e-oz
Copy link
Author

e-oz commented Nov 30, 2013

I've unchecked all modules. But 'ngmin' was not in that modules list. Where can I add --minsafe in gruntfile.js to make it default behavior?

@eddiemonge
Copy link
Member

ngmin is in the gruntfile automatically, whether you choose minsafe or not.

Again, what changes did you make to the code? could you post it somewhere?

@e-oz
Copy link
Author

e-oz commented Nov 30, 2013

https://gist.github.com/jamm/92620a57520ed4507170 - it's my gruntfile.

@e-oz
Copy link
Author

e-oz commented Nov 30, 2013

And grunt build output:
https://gist.github.com/jamm/2f063d17c3f30041ff33

@eddiemonge
Copy link
Member

not your gruntfile, your actual code. The problem isnt in the gruntfile, its in the app code

@e-oz
Copy link
Author

e-oz commented Nov 30, 2013

heh, no, there is nothing "unusual" in this small app. It's not my first app but it's first time when with generator-angular I have to use minsafe syntax.

https://gist.github.com/jamm/6127fc2cd6a54c207c93 (without array-syntax minification doesn't work).

app.js is very simple:

'use strict';
angular.module('findCardApp', []);

@eddiemonge
Copy link
Member

if thats your only file then ngmin should have worked out of the box

@eddiemonge
Copy link
Member

For now, you have to pass --minsafe everytime you call yo angular(:xyz)

@e-oz
Copy link
Author

e-oz commented Dec 4, 2013

if thats your only file then ngmin should have worked out of the box
but it doesn't.

strange enough way to response to issue ticket. "it should work. closed".
ok, it's open-source and your own time, I understand.

For now, you have to pass --minsafe everytime you call

pff.. it's stupid. sorry, but it's really annoying.

@eddiemonge
Copy link
Member

@Jamm If you can zip up your whole project and send it to me I'll test it and if I find its an actual bug I'll reopen this or fix the generator. If it's not a bug in the generator, I'll tell you whats wrong with your code so you can get back to being productive. If that's not being extra helpful, well there is only so much I can do.

As to the minsafe option, here are my thoughts on that: #452 (comment). if it stays in, mabe it could be added to the config file I am working on (in my head at the moment) that stores this kind of stuff.

@e-oz
Copy link
Author

e-oz commented Dec 4, 2013

https://dl.dropboxusercontent.com/u/63808427/find_card.7z it's full copy (without node_modules) of currently working app (some russian words in html - hope it's not a problem). App was for deadline "yesterday" - sorry for code. It's pretty small.
I don't need any fixes because I have working version, but if it will help you to find a bug - that's what I'm trying to do :)

@eddiemonge
Copy link
Member

I guess I should have looked closer at your gruntfile and saved us some time. You're ngmin was trying to operate on already minified files. https://gist.github.com/jamm/92620a57520ed4507170#file-gistfile1-txt-L227-L229 the cwd and dest should be .tmp/concat/scripts. Also, https://gist.github.com/jamm/92620a57520ed4507170#file-gistfile1-txt-L239-L247 is unnecessary since usemin already sets that target: https://gist.github.com/jamm/2f063d17c3f30041ff33#file-gistfile1-txt-L32-L35

@e-oz
Copy link
Author

e-oz commented Dec 5, 2013

Thank you very much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants