hsx
v0.0.5
مواقع HTML ثابتة مع JSX و SASS و WebPack (بدون رد فعل).
webpack قوية بجنونwebpack ) مزايا مميزة على gulp / grunt hsx هو CLI لسقالة مشروع جديد (انظر القالب). يتبع وصف موجز لما يوجد في الداخل:
webpack2 Swagstring-dompostcss (مع autoprefixer و rucksack )imageminwebpack-dev-serverMain السلكيpackage.json مع بعض npm scripts $ npm i hsx -gلإنشاء مشروع جديد:
# 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 devثم ، في متصفحك: http: // localhost: 3000/
لاحظ جديلة babel لتحويل JSX إلى مكالمات وظيفة sd ، بدلاً من 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 >
) معهد ماساتشوستس للتكنولوجيا. © 2017 Michael Cavalea