jarslab / babel-maven-plugin

Babel transcription plugin for Maven
MIT License
25 stars 8 forks source link

how does jsExclude work ? #14

Closed rohityadav225 closed 4 years ago

rohityadav225 commented 4 years ago

I am using babel-maven-plugin and running maven in debug mode and i see the following logs and i am not sure if the exclusion rule set using jsExclude is being used or not because the log says that the plugin is still transpiling files under external/. Please let me know if there is a way to confirm jsExclude works.

[DEBUG] [ForkJoinPool.commonPool-worker-1] transpiling my-app/src/main/webapp/js/external/MathJax/fonts/HTML-CSS/TeX/png/Main/Regular/unpacked/SpacingModLetters.js
[INFO] Transpiling my-app/src/main/webapp/js/external/MathJax/fonts/HTML-CSS/TeX/png/Main/Regular/unpacked/SpacingModLetters.js -> my-app/target/APP-1.0.0-SNAPSHOT/js/external/MathJax/fonts/HTML-CSS/TeX/png/Main/Regular/unpacked/SpacingModLetters.js

My configuration is as follows

<plugin>
    <groupId>com.jarslab.maven</groupId>
    <artifactId>babel-maven-plugin</artifactId>             
        <version>1.4</version>
    <executions>
        <execution>
            <id>js-transpile</id>
            <phase>process-resources</phase>
            <goals>
                <goal>babel</goal>
            </goals>
            <configuration>
                <verbose>true</verbose>
                <encoding>UTF-8</encoding>
                <babelSrc>${project.basedir}/src/main/resources/babel.min.js</babelSrc>
                <sourceDir>${project.basedir}/src/main/webapp/js</sourceDir>
                <targetDir>${project.basedir}/target/${project.artifactId}-${project.version}/js</targetDir>
                <jsExcludes>
                    <jsExclude>external/*.js</jsExclude>
                </jsExcludes>
                <jsIncludes>
                    <jsInclude>**/*.js</jsInclude>
                </jsIncludes>
                <presets>es2015,es2016,es2017</presets>
            </configuration>
        </execution>
    </executions>
</plugin>
milpol commented 4 years ago

external/*.js does not match my-app/src/main/webapp/js/external/MathJax/fonts/HTML-CSS/TeX/png/Main/Regular/unpacked/SpacingModLetters.js path from the log. Try using <jsExclude>external/**/*.js</jsExclude> to include all sub directories inside external.

rohityadav225 commented 4 years ago

Thanks.