在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ehirsch/gradle-react-plugin开源软件地址(OpenSource Url):https://github.com/ehirsch/gradle-react-plugin开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):Gradle plugin for ReactThis is a very simple Gradle plugin to transform JSX sources into JavaScript. It was inspired by and is using the gradle-node-plugin from Sten Roger Sandvik. React is
developed at Facebook and Instagram. Installing the pluginReleases of this plugin are hosted at BinTray (http://bintray.com) and is part of jcenter repository. Setup the plugin like this: Gradle versions since 2.1plugins {
id 'net.eikehirsch.react' version '0.4.1'
} Gradle versions below 2.1buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'net.eikehirsch.react:gradle-react-plugin:0.4.1'
}
}
apply plugin: 'net.eikehirsch.react' The plugin will also apply gradle-node-plugin for Node and NPM related tasks. (see http://github/srs/gradle-node-plugin for details). Using the pluginSimply run ./gradlew jsx to transform any js file in Configure the pluginTo change the defaults you can put all your settings into the jsx {
sourcesDir = 'src/react'
destDir = 'out'
// optional
options {
extension = 'jsx' // js is the default extension
}
} Create your own jsx taskYou can define the input and output folders without using the extension namespace like this: task myJSX( type: JSXTask ) {
sourcesDir = 'src/react'
destDir = 'out'
// optional
options {
extension = 'js' // js is the default extension
}
} (You can try this at the configuration example project) Include jsx with the buildIf you want to have your jsx sources transformed everytime you build your project, you could do something like this: processResources.dependsOn jsx
// for older gradle versions (e.g. 1.4) use:
processResources.dependsOn 'jsx' Building the PluginTo build the plugin, just type the following command: ./gradlew clean build Acknowledgments
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论