davidB / yuicompressor-maven-plugin

maven's plugin to compress (Minify / Ofuscate / Aggregate) Javascript files and CSS files using YUI Compressor
http://davidb.github.io/yuicompressor-maven-plugin/
GNU Lesser General Public License v2.1
122 stars 48 forks source link

Flatten Output? #74

Open Dhermann27 opened 10 years ago

Dhermann27 commented 10 years ago

I love this Maven plugin, but I am trying to support a team of developers and want to give them the flexibility of adding new source code to the aggregated file as well as minify standalone applications and drop them into the same place.

Here is what I have now:

            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
                <configuration>
                    <jswarn>false</jswarn>
                    <nosuffix>true</nosuffix>
                    <outputDirectory>${project.build.directory}/jsps-to-compile/js/</outputDirectory>
                    <aggregations>
                        <aggregation>
                            <removeIncluded>true</removeIncluded>
                            <insertNewLine>true</insertNewLine>
                            <inputDir>${project.build.directory}/jsps-to-compile/js/</inputDir>
                            <includes>
                                <include>**/*.js</include>
                            </includes>
                            <excludes>
                                <exclude>**/*-app.js</exclude>
                            </excludes>
                            <output>${project.build.directory}/jsps-to-compile/js/all.js</output>
                        </aggregation>
                        <aggregation>
                            <removeIncluded>true</removeIncluded>
                            <inputDir>${project.build.directory}/jsps-to-compile/js/</inputDir>
                            <includes>
                                <include>**/standalone-app.js</include>
                            </includes>
                            <output>${project.build.directory}/standalone.js</output>
                        </aggregation>
                    </aggregations>
                </configuration>
            </plugin>

As you can see, I would have to aggregate each standalone app file individually. What would be easier if I could flatten the directories into a single output during the minification step. Any ideas?

P.S. I tried to specify the sourceDirectory for minification, but every time I do that the compress goal finds each script file twice. Not sure why.

Thanks,

Dan Hermann

davidB commented 9 years ago

Sorry, I didn't receive notification for the issue. I don't understand your issue.