Webpack handlebars loader - is there a way to inject context/parameters? -
i'm trying setup webpack-dev-middleware (the middleware used in webpack-dev-server, hosted in own node application).
one of requirements have able parse application "index.hbs" through handlebars & inject html-webpack-plugin injects. (a couple scripts built bundle)
i found option use handlebars-loader , prepared configuration (according this)
{ test: /\.hbs$/, loader: "handlebars-loader" }
this works.. 'almost' part used render index.hbs (the snippet node+express app):
app.get(`${access_path}/index`, (req, res) => { res.render('index', { query: req.query }); });
that means parsing template based on query parameters. after lengthy explanation question is:
is there way can pass "context"/parameters using webpack handlebars-loader achieve same behavior using webpack serving file?
please note that development setup.
Comments
Post a Comment