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

matthewmueller picture matthewmueller  路  3Comments

kossnocorp picture kossnocorp  路  3Comments

marcosguti picture marcosguti  路  3Comments

mizchi picture mizchi  路  3Comments

rajaraodv picture rajaraodv  路  3Comments