hsx
v0.0.5
Sitios HTML estáticos con JSX, SASS y Webpack (sin reaccionar).
webpack es increíblemente poderosowebpack ) ofrece distintas ventajas sobre gulp / grunt hsx es una CLI para andamonear un nuevo proyecto (ver la plantilla). Sigue una breve descripción de lo que está dentro:
webpack2string-dompostcss (con autoprefixer y rucksack )imageminwebpack-dev-serverMain conectadopackage.json con algunos npm scripts útiles $ npm i hsx -gPara crear un nuevo proyecto:
# using node and npm
# install hsx globally
$ npm install hsx -g
# use the hsx command from the CLI to scaffold a project
# template files are copied to the CWD, unless a path is specified
$ hsx [path]
$ npm i
$ npm run devLuego, en su navegador: http: // localhost: 3000/
Tenga en cuenta la señal a babel para transformar JSX en llamadas de función sd , en lugar de React.createElement .
import sd from 'string-dom'
/** @jsx sd */
// create a simple Div component
// children is the HTML wrapped by the element
const Div = ( { children , name } ) => (
< div class = { name } >
{ children }
</ div >
)
// render it to the DOM, with some inner content
document . body . innerHTML += (
< Div name = "site" >
< h1 > hsx </ h1 >
< p > This is inside the Div component! </ p >
</ Div >
) Mit. © 2017 Michael Cavalea