我使用 Polymer 2.0,我的build设置是:
"builds": [
{
"name": "bundled",
"bundle": true,
"js": { "compile": true},
"css": { "minify": true },
"html": { "minify": true }
}]
构建后出现“找不到变量:babelHelpers”错误。
我使用的 Polymer CLI 版本是 1.1.0。
编辑:我在本地使用polymer-cli。在全局安装最新的polymer-cli后,现在我在 safari 上收到“构造函数需要‘new’运算符”和“无法构造‘HTMLElement’:请使用‘new’运算符,此 DOM 对象构造函数无法作为函数调用。”在 Chrome 上。
EDIT2:使用 webcomponents-loader.js 而不是 webcomponents-lite.js,我的问题解决了。
最佳答案
我遇到了同样的错误。问题是 index.html
从技术上讲是我的 polymer.json
配置中的入口点,但我实际提供的入口点是来 self 的服务器的另一个文件(_Layout .cshtml
因为我在后端使用 .NET)。我需要做的是在设置 "compile": true
后将编译的 index.html
文件中的代码移至我的 CSHTML 文件。问题解决了。
关于polymer-2.x - Polymer-cli - 获取 "Can’ t 查找变量 : babelHelpers"when I set compile to true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44373210/