【发布时间】:2017-10-19 15:06:32
【问题描述】:
我正在使用 Polymer 及其构建过程。捆绑的文件是通过我的 polymer.json 文件生成的。
我没有明确使用 Babel,我只是看到它被“纸张自动完成”使用。
访问网站时出现js错误,提示未定义BabelHelpers。
- 当我使用 MAJ+F5 时,它可以工作!
- 当我使用 F5 时,它不起作用 (未定义 BabelHelpers)
在本地运行时,它工作正常。当我将它部署到我的服务器时,我遇到了这个问题。
我将它作为一个独立的 Java 应用程序运行,因为它有一个 Spring 后端。 该网站作为多个入口点,它适用于所有其他入口点。
堆栈跟踪:
命令:
polymer build --js-minify --css-minify --html-minify
polymer.json 文件
{
"entrypoint": "pt.html",
"builds": [{
"bundle": true,
"js": {"compile": true, "minify": true},
"css": {"minify": true},
"html": {"minify": false},
"addServiceWorker": true
}],
"shell": "resources/elements-platform.html",
"fragments": [
"resources/html/lazy-resources.html",
"resources/html/ym-dashboard.html",
"resources/html/ym-partners.html",
"resources/html/ym-favorite.html",
"resources/html/ym-agenda.html",
"resources/html/ym-todos.html",
"resources/html/ym-profile.html",
"resources/html/ym-messages.html",
"resources/html/shop-list.html",
"resources/html/shop-detail.html"
],
"sources": [
"resources/src/**/*",
"resources/css/**/*",
"resources/data/**/*",
"resources/images/**/*",
"resources/img/**/*",
"resources/js/*",
"resources/js/cal/*",
"resources/js/countdown/*",
"resources/bower.json"
],
"extraDependencies": [
"resources/bower_components/webcomponentsjs/webcomponents-lite.min.js"
]
}
【问题讨论】: