markstory / asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.
MIT License
370 stars 125 forks source link

no output with uglifyjs on windows #286

Open ebrost opened 8 years ago

ebrost commented 8 years ago

i'm using the plugin for cake2 and everything seem ok but i can't get any js file while uglify is declared

my ini file:

;
[General]
cacheConfig = false
alwaysEnableController = false

[filter_UglifyJs]
node=C:\nodejs\node.exe
;node_path=C:\Users\manu\AppData\Roaming\npm\node_modules
node_path=node_modules\uglify-js\bin
uglify =C:\Users\manu\AppData\Roaming\npm\node_modules\uglifyjs\bin\uglifyjs

[js]
;baseUrl = http://cdn.example.com
timestamp = true
paths[] = WEBROOT/*
paths[] = WEBROOT/js/*
paths[] = app/Plugin/Agenda/webroot/js/*
paths[] = app/Plugin/Administration/webroot/js/*
cachePath = WEBROOT/cache_js
;filters[] = UglifyJs

; Each target should have a section defining the files
; everything after js_* is considered the build file.
; all files included in the build are relative to the parent
; paths key.
;
; targets can include their own filters.
[common.js]
files[] = bower_components/bootstrap/dist/js/bootstrap.js
files[] = bower_components/jasny-bootstrap/dist/js/jasny-bootstrap.min.js
filters[] = UglifyJs

and the output :

`Welcome to CakePHP v2.8.4 Console
---------------------------------------------------------------
App : app
Path: C:\wamp\www\culturo\app\
---------------------------------------------------------------

Building files defined in the ini file
---------------------------------------------------------------
Saving file for common.v1465402139.js
Error: (node) util.print is deprecated. Use console.log instead.

Building files in views
---------------------------------------------------------------
Done.
markstory commented 8 years ago

I've never used node on windows, so I don't think I'll be much help. You might have to dig through the UglifyFilter and see where things are going wrong.

ebrost commented 8 years ago

Ok. after diing ( aliitel), le probleme eis comming from the exception thrown in function _rumcmd:

if ($Process->error()) {
            throw new RuntimeException($Process->error());
        }

wich is blocking the file generation despite the fact the "error" is much more a warning...

As i'm in a hurry, i just change it to :

if ($Process->error()) {
            var_dump($Process->error());
        }
raisen commented 7 years ago

I was facing similar problem on a Linux machine, and I fixed by using this version of UglifyJS.