I am trying to minify all js files (start with controllers and app.js). As we know that regular minifier (uglify etc) won't work directly on angularjs files because of module declaration conventions.
So I tried using ngmin for that.
Concatenated all files and then tried using ngmin - but get this error ...
C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\node_modules\esprima\espri
ma.js:3872
throw e;
^
Error: Line 1007: Unexpected token *
at throwError (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\node_mo
dules\esprima\esprima.js:1156:21)
at throwUnexpected (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngmin\no
de_modules\esprima\esprima.js:1213:9)
at parsePrimaryExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\n
gmin\node_modules\esprima\esprima.js:1567:16)
at parseLeftHandSideExpressionAllowCall (C:\Users\Rahul\AppData\Roaming\npm\
node_modules\ngmin\node_modules\esprima\esprima.js:1644:61)
at parsePostfixExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\n
gmin\node_modules\esprima\esprima.js:1703:20)
at parseUnaryExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngm
in\node_modules\esprima\esprima.js:1784:16)
at parseMultiplicativeExpression (C:\Users\Rahul\AppData\Roaming\npm\node_mo
dules\ngmin\node_modules\esprima\esprima.js:1790:20)
at parseAdditiveExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\
ngmin\node_modules\esprima\esprima.js:1807:20)
at parseShiftExpression (C:\Users\Rahul\AppData\Roaming\npm\node_modules\ngm
in\node_modules\esprima\esprima.js:1824:20)
at parseRelationalExpression (C:\Users\Rahul\AppData\Roaming\npm\node_module
s\ngmin\node_modules\esprima\esprima.js:1845:16)
I believe the issue is related to running ngmin in windows environment. I shall try it again with Mac - but trying to gauge if anybody faced this issue and able to find any work-around ?
Thanks in advance ...
It looks like this might be related to concatenating. It's most likely not a Windows issue (I've run ngmin on Windows just fine). There's an open issue for this: https://github.com/btford/grunt-ngmin/issues/12.
I know the recommendation is to run it once on a concatenated file, but you might want to try running ngmin prior to concatenation and see what happens. If that ends up fine, try to concatenate afterwards.
Related
I created a new application with react native windows, and it works well the first (few) times I run it, however, when closing the application I always end up with the following warning:
Attempt by security transparent method 'System.Reactive.Concurrency.CoreDispatcherScheduler..ctor(Windows.UI.Core.CoreDispatcher)' to access security-critical type 'Windows.UI.Core.CoreDispatcher' failed.
I've tried this on more than one computer and all of them get the same error but I can't find a way to fix this, meaning I cant proceed with my Native project in fear that it will malfunction every day.
How do I fix this, to stop this from happening again, or is it a bug?
I'm a novice in React Native myself, but here are a few suggestions:
1) There's an issue logged in GitHub on this exact problem: https://github.com/Microsoft/react-native-windows/issues/1954
2) I personally find that I get this with command-line execution (react-native run-windows) but I don't think(?) that I've seen it when running from inside Visual Studio. Try that approach to running instead.
3) As described at GitHub - I've found that deleting windows\Debug folder before running tends to resolve the issue.
The scenario is easy - I create PDFs with wkhhtmltopdf, and sometimes I struggle with things like
window.performance
not supported by this version.
So scripts are not fully executed.
Until now my way to find errors like that, was to use the very old Windows Safari browser, that helped me finding these errors.
But now I have a script error with the old wkhtmtlopdf, that does not even show in windows Safari.
I found it (or not really) with heavy and nasty script changing (comment out the half), but I would like to know if there is a way to get the correct error with wkhtmtlopdf while parsing.
Run wkhhtmltopdf with the command line using --debug-javascript argument.
Please help, I can't seem to get an answer for this anywhere.
If I use the Cordova file plugin to try and access the application directory on Windows 8, it always fails! Here is the basic code I am using:
window.resolveLocalFileSystemURL(cordova.file.dataDirectory + 'www/assets/images/image.png', gotFile, fail);
I have been using the same basic code on the Android and iOS versions of the app for some time now with no problem so I don't understand why the Windows 8 version doesn't like it.
Through console logs I can see that the link generated is in fact correct and it's actually exactly the same as one used to append the same image to the page (which works fine):
<img src="ms-appx:///www/assets/images/image.png">.
Can anyone please tell me why I can't use cordova.file.applicationDirectory with Windows? I know that folder is read only, I am just trying to read from it.
Note: I can use window.resolveLocalFileSystemURL with the cordova.file.applicationDirectory no problem at all, it works as expected. Its only the cordova.file.dataDirectory that always fails for me. The closest answer I could find was some people having trouble with the image paths of images saved from the camera plugin but that seems to have been a bug that was fixed by Cordova. If this is not a bug also then I'm assuming there is something really simple I can do to make the resolveLocalFileSystemURL work?
Thanks.
I found a solution to my problem by using 'windows.storage.storagefile', I had success with the following code:
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(new Windows.Foundation.Uri('ms-appx:///www/test.html')).done(win, fail);
More info can be found here: msdn.microsoft.com/library/windows/apps/… I hope this helps some other people struggling with Windows 8 as I spent quite a time scratching my head about it and trying lots of different ways.
Cheers,
Stuart
We've been using protobuf for a while at work and I decided to write a little console app for a client which would allow them to do some testing on site.
I started a new c# console app and downloaded google.protocolbuffers and protobuf-net from nuget.
What I'm trying to achieve is to turn my "messages.proto" file into "messages.cs"
I've tried to get the protobuf to build the messages file on a prebuild event but with no success, it seems the command arguments have changed since our first implementation. I followed the example here
http://code.google.com/p/protobuf-csharp-port/wiki/ProtoGen
And added the following pre build event
"$(projectdir)packages\Google.ProtocolBuffers.2.4.1.473\tools\protogen.exe" --proto_path=./protos protos/messages.proto --include_imports -output_directory=./
However I get the following error
Input file protos/messages.proto doesn't exist.
I've tried all sorts of combinations but nothing seems to work. Am I approaching this all wrong or is there a gotcha here? Any help much appreciated!
Have you tried using the absolute paths? I vaguely recall having a similar issue myself that turned out to be an issue with it not resolving relative paths correctly.
Has anyone been able to get anything past 4.0b1 of firefox either nightly or releases to build with jssh enabled in the .mozconfig, I get the error .js component without matching .manifest and if I change the rules I get a missing header file, which if I manually copy to the jssh directory and then build gives many many compile errors, was wondering if anyone knew what was going on with jssh as I managed to build it for 4.0b1 and it worked fine (except for an issue involving td tags and events within those tags). I just hope mozilla doesn't discontinue jssh. Any answers would be appreciated.
Looks like it is known, but may not be fixed.
for JSSH users,
we have created a solution over MozRelp that simulates JSSH.
It's also very fast, since it execute JS on the fly and avoid execute it from a HD File.
Downloadable extension: https://s3-us-west-2.amazonaws.com/abstracta/WatiN/mozrepl-jsshv2.6.xpi
Source: https://subversion.assembla.com/svn/mozrepl-jssh
regards,
Fabián Baptista