Preact: Possible to use with Pug instead of JSX?

Created on 13 Jul 2017  路  5Comments  路  Source: preactjs/preact

Was wondering if it would be possible to use some combination of Webpack loaders to precompile Preact components using Pug templates instead of JSX. Maybe something like this?

...
module: {
    rules: [{
        test: /\.(js|pug)$/,
        use: ["babel-loader", "pug-as-jsx"]
    }]
}
...

Most helpful comment

Could always write a webpack loader yourself

All 5 comments

I'm working on this. It's not a pug -> jsx loader though, essentially it is compiling the pug template to a virtual Dom component.

Sounds good. I'll keep an eye out for it.

is this issue have been fixed?please
If yes.How can i setup it in my project?

Could always write a webpack loader yourself

Closing this, because this is not an issue with preact itself. A compiler/bundler like webpack is the perfect place to do such transformations 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

youngwind picture youngwind  路  3Comments

jescalan picture jescalan  路  3Comments

matuscongrady picture matuscongrady  路  3Comments

k15a picture k15a  路  3Comments

adriaanwm picture adriaanwm  路  3Comments