Coder Social home page Coder Social logo

babel-maven-plugin's Introduction

Travis CI Maven Central

Babel Maven Plugin

Plugin lets you to execute Babel transcription for given JavaScript files. It requires no npm or node.js, it is plain Java project which works perfectly combined with WebJars.

Maven coords

<dependency>
  <groupId>com.jarslab.maven</groupId>
  <artifactId>babel-maven-plugin</artifactId>
  <version>1.2</version>
</dependency>

Settings, ie buttons and knobs

  • verbose - no surprises, the execution becomes a bit more talkative (default: false),
  • parallel - if true will run files transpilation in parallel (on ForkJoin pool) (default: true),
  • encoding - will apply chosen encoding during files operations (read/write) (default: Charset.defaultCharset()),
  • babelSrc - readable path to standalone(!) Babel sources. It can be provided from WebJars dependency, minified or development version,
  • sourceDir - base path for JavaScript files you are going to translate,
  • targetDir - result path, note that all sub-directories from sourceDir will be preserved,
  • jsFiles - list of JavaScript files (static) from sourceDir to translate,
  • jsIncludes - list of JavaScript files (with simple masks */?),
  • jsExcludes - list of exceptions for jsIncludes,
  • prefix - optional prefix applied for every translated file,
  • presets - presets for Babel execution (default: es2015),

Example

<plugin>
    <groupId>com.jarslab.maven</groupId>
    <artifactId>babel-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution>
            <id>js-transpile</id>
            <phase>process-resources</phase>
            <goals>
                <goal>babel</goal>
            </goals>
            <configuration>
                <verbose>true</verbose>
                <babelSrc>${project.basedir}/target/classes/assets/jslib/babel.min.js</babelSrc>
                <sourceDir>${project.basedir}/target/classes/assets/</sourceDir>
                <targetDir>${project.basedir}/target/classes/assets/</targetDir>
                <jsSourceIncludes>
                    <jsSourceInclude>src/*.js</jsSourceInclude>
                </jsSourceIncludes>
                <prefix>trans-</prefix>
                <presets>react,es2015</presets>
            </configuration>
        </execution>
    </executions>
</plugin>

babel-maven-plugin's People

Contributors

milpol avatar cvouto02 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.