Converts JSX to Objects (JSON) using blood magic.
npm install --save jsxobjimportjsxobjfrom'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"
}
}
}