-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imports choking esbuild --bundle #341
Comments
An easy way to avoid this problem with esbuild is to move each conditional exports.velocityjs.render = function(str, options, cb) {
return promisify(cb, function(cb) {
- var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
try {
+ var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
options.locals = options;
cb(null, engine.render(str, options).trimLeft());
} catch (err) {
cb(err);
}
});
}; This signals to esbuild that the |
PR welcome |
@niftylettuce please i made the PR ? Thanks |
@niftylettuce any chance to merge my fix? |
@jacargentina we are merging your fix into our new repo 🙏 We have forked this repository for maintenance and released it under PR welcome at the new repo once new release is published today! |
…or API changes in v8, removed support for razor-tmpl removed marko support (per <fastify/point-of-view#218>), fixed try/catch issues (per <tj#341>)
v1.0.0 of watch/follow https://github.com/ladjs/consolidate for updates and to submit future issues and PR's |
Hi! For a toy project of mine I used
koa-views
, which usesconsolidate
, and noticed that the wayconsolidate
does requires chokes upesbuild --bundle
, causing me to have to manually mark every single template engine I'm not using asexternal
, which inesbuild
means it won't care for them.This however is quite a chore and if there's ever a change in the supported engines will mean I'll have to update this list by hand which is ... not ideal.
One way I thought could potentially work -and will likely test for viability shortly- is abstracting the
require
calls such that the bundling tools no longer get confused about all those conditional calls?I created evanw/esbuild#2033 over at
esbuild
so someone can at some point have a shot at solving it, but also wanted to let y'all know this is a thing that happens.Cheers!
The text was updated successfully, but these errors were encountered: