Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve sub-directory structure when only minifying #29

Closed
AFaust opened this issue Jul 12, 2013 · 11 comments
Closed

Preserve sub-directory structure when only minifying #29

AFaust opened this issue Jul 12, 2013 · 11 comments
Assignees
Labels
Milestone

Comments

@AFaust
Copy link
Contributor

AFaust commented Jul 12, 2013

As stated in an after-fix comment on #17 a minification without merging (skipMerge = true) currently removes any subdirectory structure captured by jsSourceIncludes / cssSourceIncludes which can be very problematic for projects relying on that sub-directory structure.

From the after-fix comment:

For example, when jsSourceDir="js and jsSourceInclude="*/.js
minifying: /src/main/webapp/js/some/path/a.js
creates: /target//webapp/js/a.min.js
I think it could have been more convenient if the result were created at: /target//webapp/js/some/path/a.min.js

@timothystone
Copy link

I seriously need this for my Stripes project in the Java 1.6 compatible builds. Vote +1. Find me on the Stripes IRC channel.

@samaxes
Copy link
Owner

samaxes commented Aug 22, 2013

@AFaust Can you please test the branch preserve-subdirs and check if it is working for you?

@ghost ghost assigned samaxes Aug 22, 2013
@samaxes
Copy link
Owner

samaxes commented Aug 23, 2013

@timothystone I've merge this fix into the branch v1.6.X. Please update the plugin version in your POM file to 1.6.1.

@timothystone
Copy link

@samaxes thanks! I'll test it today!

@samaxes
Copy link
Owner

samaxes commented Aug 25, 2013

Merged into master.

@samaxes samaxes closed this as completed Aug 25, 2013
@pankaj3-s
Copy link

Hi,

I want to use this preserve sub directory feature, but could not find the example how to enable it.

Can you please let me know how to use this feature in Release 1.6.1? What attribute do I need to include in my pom.xml inside this plugin tag?

@pankaj3-s
Copy link

I downloaded the demo example from the Release 1.6.1 https://github.com/samaxes/minify-maven-plugin/releases/download/minify-maven-plugin-1.6.1/minify-maven-plugin-demo-1.6.1-src.zip

When I ran the command mvn clean install, it merges all js (from subfolders also) into single one. I don't want to merge and maintain the original folder structure.

@timothystone
Copy link

<nomunge>true</nomunge>
<skipMerge>true</skipMerge>

This is what I'm using and it works. Admittedly I'm using a custom spin of this plugin, but it's based on 1.6.1 and only adds a feature from 1.7 (nosuffix).

@pankaj3-s
Copy link

Thanks Timothystone...it works !! :)

@timothystone
Copy link

BTW, if you want "my custom spin" which ports the "nosuffix" feature from 1.7 to 1.6, pick up my pull request: #39

@samaxes
Copy link
Owner

samaxes commented Feb 22, 2014

Hi guys,

nomunge is optional here. It's only used by YUI Compressor for JavaScript compression.
The option skipMerge should be enough.

Cheers

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

No branches or pull requests

4 participants