Open wiloke1 opened 6 years ago
i'm use pug
const pug = require('pug')
const withHotloader = require('express-engine-hotloader')
var app = require('express')()
const server = require('http').Server(app)
const engine = process.env.NODE_ENV !== 'production'
? withHotloader(server, pug)
: pug
app
.engine('pug', engine)
.set('view engine', 'pug')
.get('/', (req, res) => { res.render('home') })
server.listen(3000, () => {
console.log('listening on 3000')
})
error:
initEngine.apply is not a function
@wiloke1 This looks like a bug. Thanks for reporting! Ill push a fix today.
I'm waiting for the update for Pug template thank you @des-des thank you express-engine-hotloader <3
@wiloke1 okay, I think there is now a working example for pug in this repo, with a new version that fixes a bug (you will need to update to version 2)
So pug now works with express, update me about it working for webpack!
@wiloke1 Is it possible for you to send me the entire codebase?
@des-des Can you teamview help me? skype: hpvanlong
@wiloke1 thankyou for your patience, the latest version should have a fix!
@des-des (Y) demo webpack https://www.dropbox.com/s/b52bvcpw40yew3m/webpack-HMR-and-pug-template.zip?dl=0 You can use it for example
@wiloke1 I am a bit confused about how hotloader and webpackHotMiddleware are interacting.
Am I correct to say you are using webpack to load the css? What is the goal of this, how would this work if webpack was used for more things?
Can you tell me, does this work to update the DOM with new css, and without a page reload?
webpack.config.js
router.js