我已经开发了一些模具组件,但是在生产之后,构建了普通HTML中包含的dist js,并将该组件用作
<my-comp></my-comp>在那里不工作,在严格模式下不允许调用delete (包括)时出错。

下面是我的模具配置
import { Config } from '@stencil/core'
import { sass } from '@stencil/sass'
export const config: Config = {
namespace: 'mep-components',
srcDir: 'src',
buildEs5: true,
extras: {
cssVarsShim: true,
dynamicImportShim: true,
shadowDomShim: true,
safari10: true,
scriptDataOpts: true,
appendChildSlotFix: false,
cloneNodeFix: false,
slotChildNodesFix: true,
},
outputTargets: [
{
type: 'dist'
},
{
type: 'www'
}
],
devServer: {
reloadStrategy: 'pageReload',
port: 4444
},
plugins: [sass()]
}下面是JSON package.json包
{
"name": "web-components",
"module": "./dist/index.js",
"collection": "./dist/collection/collection-manifest.json",
"types": "./dist/types/components.d.ts",
"version": "1.0.0",
"description": "",
"main": "./dist/index.cjs.js",
"scripts": {
"start": "stencil build --dev --watch --serve",
"build": "stencil build --prod && node ./src/tasks/after.build.js",
"server": "json-server --watch db.json",
"task": "node ./src/tasks/someTask.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@stencil/core": "^2.6.0",
"moment-timezone": "^0.5.33",
"stencil-click-outside": "^1.7.1",
"uuid": "^8.3.2"
},
"devDependencies": {
"@stencil/sass": "^1.4.1",
"@types/jquery": "^3.5.6",
"chalk": "^4.1.2",
"workbox-build": "^4.3.1"
}
}发布于 2022-01-19 07:37:24
模板2.0中的一个重大变化是,默认情况下,对11的支持是禁用的,现在它已经被选中了。您需要手动启用它。
https://stackoverflow.com/questions/70566217
复制相似问题