google-code-export / wro4j

Automatically exported from code.google.com/p/wro4j
1 stars 1 forks source link

enable support for react.js jsx files compilation #912

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
JSX is a popular format used in react.js framework. JSX files can be 
transformed into js file using jsx utility which comes with react-tools node.js 
package. Right now I use a small ant script inside my maven project to generate 
js sources. 

<property name="resources.path" value="${user.dir}/src/main/webapp/resources"/>
    <property name="output.path" value="${user.dir}/target/generated-sources/web-resources" />

    <target name="create-files">
        <touch mkdirs="true">
            <fileset dir="${resources.path}" includes="**/*.jsx"/>
            <mapper type="glob" from="*.jsx" to="${output.path}/*.js" />
        </touch>
    </target>

    <target name="transform-jsx" >
        <apply executable="/usr/local/bin/jsx"
               logerror="true" verbose="true">
            <fileset dir="${resources.path}" includes="**/*.jsx"/>
            <redirector createemptyfiles="">
                <outputmapper type="glob" from="*.jsx" to="${output.path}/*.js"/>
            </redirector>
        </apply>
    </target>

It would be nice if WRO could process jsx files.

Original issue reported on code.google.com by asho...@gmail.com on 29 Dec 2014 at 6:31