teamcfadvance / cfstatic

CfStatic is a framework for managing the inclusion and packaging of CSS and JavaScript in CFML applications.
https://teamcfadvance.github.io/cfstatic
MIT License
102 stars 35 forks source link

minifyMode='none' generates extra folder in path with same name as file #8

Closed cfsimplicity closed 13 years ago

cfsimplicity commented 13 years ago

Excellent project. Dominic! Just what I've been looking for.

Could be me doing something wrong, but if I set minifyMode to 'none' in the config, or use the debug url switch, renderIncludes() seems to add an extra folder to the outputted path which has the same name as the file being included.

Here's my folder structure:

/test
    Application.cfc
    index.cfm
    /cfstatic
        /static
            /css
                styles.css

Here's the config I'm passing when creating my CfStatic instance:

var config  =   
            {
                staticDirectory     =   ExpandPath( "./static/" )
                ,staticUrl  =   "/test/cfstatic/static"
                ,minifyMode =   "none"
            };

When I do #cfstatic.renderIncludes()# (either css, js or both) the path comes out as:

<link media="screen, projection" href="/test/cfstatic/static/css/styles/styles.css?20110922102450" rel="stylesheet">

See the extra "/styles/" folder? It's always named the same as the included file. Obviously means the path is invalid.

Doesn't happen with minification turned on.

I'm using r1_beta1.1

Cheers Julian.

DominicWatson commented 13 years ago

Roger that. Will take a look. I'd be interested to know what you're using minifyMode='none' for, just for dev mode? I personally like to minify my files even in local dev, using debug=true to see them unminified. I put it in there so you could do just that though, of course (not saying mine is the right way).

DominicWatson commented 13 years ago

That's most odd indeed, not seeing that locally on either ColdFusion 9.0.1 on Windows & Linux or Railo 3.2 on Linux. What is your environment? Would it possible to send me a zip of your static folder so I might be able to build a test to reproduce?

Oh, and glad you like it ;)

cfsimplicity commented 13 years ago

I was just testing out the various options, Dominic - trying to understand what "debug" meant. I agree that in practice I can't see myself using it even in dev: if I want to see the unminified "source" files then they're right there at all times.

DominicWatson commented 13 years ago

Ah roger that. I've managed to reproduce your issue, it happens when the files sit in the root css / js directories (I've always used subdirectories). I'll fix that up asap (in the mean time, you could organize your files in subdirs).