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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -