hyperstyles-loader
Hyperscript + CSS modules + Hyperstyles + Webpack
I’ve been using hyperscript in place of JSX. The problem is that it’s so verbose to use with CSS modules.
// JSX<div className=stylesroot>Text</div> // hyperscript
Now there’s hyperstyles
that merges the hyperscript
and styles
together.
const h =
Now that’s much better, except now I have to require three files instead of one! So I created this webpack loader.
Now it’s so short!!!!
Example webpack configuration:
module: loaders: test: /\.styl$/ loaders: 'hyperstyles?h=react-hyperscript' // <-- 'style' 'css?modules' 'postcss' 'stylus'
Substitute style!css
for css/locals
for prerendering!