0
我預編譯模板使用以下命令:把手預編譯模板無法導入
handlebars -m -e html ./templates/ > ./templates/templates.js
然後我嘗試導入生成的文件在我的javascript:
import './templates/templates.js';
會拋出一個錯誤:
Uncaught ReferenceError: Handlebars is not defined
此錯誤與完整或運行時間一起出現,僅包含Handlebars。我使用Handlebars 4.0.5並將一個項目與Webpack捆綁在一起。
你能幫忙嗎?