Я создал собственный веб-компонент, используя Lit-Element, и он отлично работает с Chrome, Firefox, Eadge, Opera, но не работает в IE 11. Я также пытался скомпилировать его в es5, но все равно не повезло.
Ошибка в консоли IE:
Правило веб-пакета:
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
plugins: ['@babel/plugin-syntax-dynamic-import'],
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
targets: '>1%, not dead, not ie 11'
}
]
]
}
}
]
},
package.json
{
"name":"pwa-conf-app",
"main":"sw.js",
"scripts":{
"webpack":"webpack",
"webpack-dev-server":"webpack-dev-server --history-api-fallback",
"build":"npm run webpack -- --env.mode production --env.presets
serviceworker",
"dev":"npm run webpack-dev-server -- --env.mode development",
"dev:sw":"npm run webpack-dev-server -- --env.mode development --
env.presets serviceworker"
},
"keywords":[
],
"devDependencies":{
"@babel/core":"^7.1.5",
"@babel/plugin-syntax-dynamic-import":"^7.0.0",
"@babel/preset-env":"^7.1.5",
"babel-loader":"^8.0.4",
"babel-preset-minify":"^0.5.0",
"clean-webpack-plugin":"^0.1.19",
"copy-webpack-plugin":"^4.5.2",
"css-loader":"^1.0.0",
"html-webpack-plugin":"^3.2.0",
"mini-css-extract-plugin":"^0.4.1",
"style-loader":"^0.21.0",
"webpack":"^4.23.1",
"webpack-cli":"^3.0.8",
"webpack-dev-server":"^3.1.4",
"webpack-merge":"^4.1.3",
"workbox-webpack-plugin":"^3.3.1"
},
"dependencies":{
"@webcomponents/webcomponentsjs":"^2.1.3",
"babel-preset-es2015":"^6.24.1",
"lit-element":"^2.0.0"
}
}