如何" url-loader" Express + Webpack + Handlebars中的图像

时间:2016-03-05 11:14:53

标签: javascript node.js handlebars.js webpack

您好我使用Express with Handlebars作为视图引擎,并且想知道如何在我的模板中嵌入图像并使它们变得可见"可见"到Webpacks' def paint = { val newPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG) newPaint setTextSize getResources.getDimensionPixelSize(R.dimen.text_size) newPaint setTypeface Typeface.create("Droid Sans", Typeface.NORMAL) newPaint setTextAlign Paint.Align.CENTER newPaint setStyle Paint.Style.FILL newPaint setColor Color.BLACK newPaint } def drawText(canvas: Canvas, text: String, x: Float, baseY: Float) = { val layout = new StaticLayout(text, paint, textBounds, ALIGN_NORMAL, 1.0f, 0.0f, false) val y = baseY - layout.getHeight / 2f canvas.save canvas.translate(x, y) layout draw canvas canvas.restore } drawText(canvas, gText, bitmap.getWidth / 2, topSize / 2)

也许一种可能的解决方案是使用url-loader,但我不想使用它。

我想要实现的目标是使用Handlebars'相当于Jades'

handlebars-loader

但没有使用img(src=require("./my/image.png")) 。感谢

0 个答案:

没有答案