Fix ES5 build, fix virtualizer polyfill (#7451)

This commit is contained in:
Bram Kragten
2020-10-22 22:43:15 +02:00
committed by GitHub
parent 89b07ea0ae
commit 7428731eac
9 changed files with 46 additions and 20 deletions

View File

@@ -51,9 +51,6 @@ const createWebpackConfig = ({
}),
],
},
experiments: {
topLevelAwait: true,
},
plugins: [
new ManifestPlugin({
// Only include the JS of entrypoints
@@ -98,6 +95,15 @@ const createWebpackConfig = ({
new RegExp(bundle.emptyPackages({ latestBuild }).join("|")),
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// We need to change the import of the polyfill for EventTarget, so we replace the polyfill file with our customized one
new webpack.NormalModuleReplacementPlugin(
new RegExp(
require.resolve(
"lit-virtualizer/lib/uni-virtualizer/lib/polyfillLoaders/EventTarget.js"
)
),
path.resolve(paths.polymer_dir, "src/resources/EventTarget-ponyfill.js")
),
],
resolve: {
extensions: [".ts", ".js", ".json"],