准备好这两份文件。
package.json
{
"dependencies": {
"lit-html": "^1.1.0"
},
"browserslist": [
"IE 11"
]
}index.js
import {html, render} from "lit-html"
const foo = () => {}然后,用包裹建造它们。
parcel build index.js部分结果是
"use strict";var t=require("lit-html"),i=function(){};箭头函数被编译成标准函数表达式。这是预期的行为。
但是,结果中有一些箭头函数。
t=t=>(...s)=>{const这是lit模块的一部分。
包可以编译到ES5,包括依赖模块吗?
发布于 2019-06-11 13:53:01
请查看以下链接:https://github.com/parcel-bundler/parcel/issues/1037
{
"name": "pc",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-preset-env": "^1.6.1",
"parcel-bundler": "^1.6.2"
},
"private": true,
"scripts": {
"build": "parcel build src/index.js"
},
"dependencies": {
"sweetalert2": "^7.17.0"
}
}https://stackoverflow.com/questions/56545154
复制相似问题