G
G
Gibi2016-01-07 19:43:49
JavaScript
Gibi, 2016-01-07 19:43:49

How to make a webpack template *.jade entry point?

Hello.
Now I have something like

entry: {
      application: _path + '/app/app.js'
    }

    plugins: [
      new HtmlPlugin({
        title: 'Title',
        chunks: ['application', 'vendors'],
        filename: 'index.html',
        template: path.join(_path, 'app', 'assets', 'templates', 'layouts', 'index.html')
      })
    ]

And the entry point is app.js, which includes styles, js, and so on.
All this is included in index.html.
Is it possible somehow to include index.jade instead of index.html? It is clear that then all this should be compiled into html.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rodion Shergin, 2016-01-15
@beh

in the 2nd version of html-webpack-plugin you can use loaders for templates

{
    entry: {
        application: _path + '/app/app.js'
    }
    module: {
        loaders: [{
            test: /\.jade$/,
            loader: "jade-loader"
        }]
    },
    plugins: [
        new HtmlPlugin({
            title: 'Title',
            chunks: ['application', 'vendors'],
            filename: 'index.html',
            template: path.join(_path, 'app', 'assets', 'templates', 'layouts', 'index.jade')
        })
    ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question