![](/img/trans.png)
[英]ES6 Class extends Array: workaround for ES5 Babel transpile
[英]Webpack babel transpile to es5 doesn't quite work
我正在嘗試將我的 ES7 源代碼構建到一個文件中並將其轉換為 ES5,但是當我運行 webpack 時,我仍然注意到構建包中的這樣的代碼
t.exports=class extends n(0).Component{title(){return this.constructor.name}}}
類的導出意味着有些東西不太正常,這是我相關的 webpack 配置
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ["env"]
}
}
},
我究竟做錯了什么?
為了節省其他人我浪費的寶貴的幾個小時 - 我包含了包含來自 node_modules 的 ES5+ 代碼的庫,而且很明顯,配置忽略了 node_modues,所以我只需要刪除該行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.