Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

jsxobjNPMtravis-ci

Converts JSX to Objects (JSON) using blood magic.

npm install --save jsxobj

Example

importjsxobjfrom'jsxobj';// example of an import'd pluginconstCustomPlugin=config=>({
...config,name: 'custom-plugin'});console.log(<webpacktarget="web"watch><entrypath="src/index.js"/><resolve><aliasfrom="react"to="preact-compat"/><aliasfrom="react-dom"to="preact-compat"/></resolve><plugins><uglify-jsopts={{compression: true,mangle: false}}/><CustomPluginfoo="bar"/></plugins></webpack>);

The above outputs:

{
"name": "webpack",
"target": "web",
"watch": true,
"entry": {
"path": "src/index.js"
},
"resolve": {
"alias": {
"from": "react-dom",
"to": "preact-compat"
}
},
"plugins": {
"uglify-js": {
"opts": {
"compression": true,
"mangle": false
}
},
"custom-plugin": {
"foo": "bar"
}
}
}

About

Build JSON using JSX 🌈 (may contain blood magic)

Topics

Resources

Stars

221 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages