From e374da2e959573060e5597f827d210c6cd6b47d1 Mon Sep 17 00:00:00 2001 From: Thomas Allmer Date: Thu, 22 Oct 2020 08:28:32 +0200 Subject: [PATCH] chore: move webpack tools into the legacy repo --- README.md | 36 +- docs/building/README.md | 2 +- packages/building-webpack/CHANGELOG.md | 1459 ----------------- packages/building-webpack/README.md | 417 +---- .../demo/js/a/b/import-meta-test-2.js | 3 - packages/building-webpack/demo/js/demo-app.js | 54 - .../demo/js/demo-component.js | 18 - packages/building-webpack/demo/js/index.html | 23 - packages/building-webpack/demo/js/index.js | 22 - .../demo/js/lazy-component.js | 17 - packages/building-webpack/demo/js/syntax.js | 27 - .../demo/js/webpack.config.js | 19 - .../demo/js/webpack.modern.config.js | 12 - .../building-webpack/demo/ts-babel/.babelrc | 7 - .../demo/ts-babel/a/b/import-meta-test-2.ts | 4 - .../demo/ts-babel/demo-app.ts | 51 - .../demo/ts-babel/demo-component.ts | 17 - .../building-webpack/demo/ts-babel/index.html | 23 - .../building-webpack/demo/ts-babel/index.ts | 22 - .../demo/ts-babel/lazy-component.ts | 16 - .../building-webpack/demo/ts-babel/syntax.ts | 27 - .../demo/ts-babel/webpack.config.js | 19 - .../demo/ts-babel/webpack.modern.config.js | 12 - packages/building-webpack/index.js | 4 - .../modern-and-legacy-config.js | 191 --- packages/building-webpack/modern-config.js | 163 -- packages/building-webpack/package.json | 72 - .../building-webpack/src/get-default-mode.js | 11 - .../building-webpack/test/integration.test.js | 106 -- packages/webpack-import-meta-loader/.babelrc | 10 - .../webpack-import-meta-loader/CHANGELOG.md | 226 --- packages/webpack-import-meta-loader/LICENSE | 21 - packages/webpack-import-meta-loader/README.md | 34 +- .../webpack-import-meta-loader/package.json | 37 - .../src/to-browser-path.js | 5 - .../test/caseA/index.js | 2 - .../test/caseA/return.js | 1 - .../test/caseB/caseBsub/caseBsub.js | 1 - .../test/caseB/index.js | 3 - .../test/compiler.js | 28 - .../test/to-browser-path.test.js | 14 - .../test/webpack-import-meta-loader.test.js | 50 - .../webpack-import-meta-loader.js | 57 - .../webpack-index-html-plugin/CHANGELOG.md | 544 ------ packages/webpack-index-html-plugin/README.md | 264 +-- .../webpack-index-html-plugin/package.json | 44 - .../src/create-entrypoints.js | 117 -- .../src/emit-index-html.js | 147 -- .../webpack-index-html-plugin/src/utils.js | 57 - .../test/custom-polyfills/polyfill-a.js | 10 - .../test/custom-polyfills/polyfill-b.js | 10 - .../test/custom-polyfills/polyfill-b.js.map | 1 - .../test/fixtures/external-loader/app.js | 4 - .../test/fixtures/external-loader/index.html | 30 - .../test/fixtures/external-loader/lazy.js | 1 - .../external-loader/webpack.config.js | 39 - .../test/fixtures/legacy-multi-index/app.js | 4 - .../fixtures/legacy-multi-index/index.html | 30 - .../test/fixtures/legacy-multi-index/lazy.js | 1 - .../legacy-multi-index/webpack.config.js | 59 - .../test/fixtures/legacy/app.js | 4 - .../test/fixtures/legacy/index.html | 30 - .../test/fixtures/legacy/lazy.js | 1 - .../test/fixtures/legacy/webpack.config.js | 38 - .../test/fixtures/manual-entry/app.js | 4 - .../test/fixtures/manual-entry/index.html | 28 - .../test/fixtures/manual-entry/lazy.js | 1 - .../fixtures/manual-entry/webpack.config.js | 18 - .../test/fixtures/manual-inject/app.js | 4 - .../test/fixtures/manual-inject/index.html | 30 - .../test/fixtures/manual-inject/lazy.js | 1 - .../fixtures/manual-inject/webpack.config.js | 29 - .../test/fixtures/multi-entry/app.js | 4 - .../test/fixtures/multi-entry/index.html | 23 - .../test/fixtures/multi-entry/lazy.js | 1 - .../multi-entry/second-entry-point.js | 1 - .../fixtures/multi-entry/webpack.config.js | 13 - .../test/fixtures/multi-index/app.js | 4 - .../test/fixtures/multi-index/index.html | 22 - .../test/fixtures/multi-index/lazy.js | 1 - .../fixtures/multi-index/webpack.config.js | 29 - .../test/fixtures/polyfills-no-hash/app.js | 4 - .../fixtures/polyfills-no-hash/index.html | 30 - .../test/fixtures/polyfills-no-hash/lazy.js | 1 - .../polyfills-no-hash/webpack.config.js | 22 - .../test/fixtures/polyfills/app.js | 4 - .../test/fixtures/polyfills/index.html | 30 - .../test/fixtures/polyfills/lazy.js | 1 - .../test/fixtures/polyfills/webpack.config.js | 21 - .../test/fixtures/single-entry/app.js | 4 - .../test/fixtures/single-entry/index.html | 30 - .../test/fixtures/single-entry/lazy.js | 1 - .../fixtures/single-entry/webpack.config.js | 13 - .../test/integration.test.js | 94 -- .../external-loader/1.6460eaa1be9cec799f97.js | 1 - .../app.3a93364ee90208c7ab18.js | 1 - .../test/snapshots/external-loader/index.html | 1 - .../legacy/1.6460eaa1be9cec799f97.js | 1 - .../legacy/app.dc126e48488aa981a60a.js | 1 - ...loader.24b9b1c6fdcdd67961a536e52578b3fd.js | 1 - ...ore-js.577a5602a7262d6256830802d4aaab43.js | 12 - ...js.577a5602a7262d6256830802d4aaab43.js.map | 12 - ...dapter.84b300ee818dce8b351c7cc7c100bcf7.js | 10 - ...er.84b300ee818dce8b351c7cc7c100bcf7.js.map | 1 - ...onents.d67d6757b8cd44bc35b021ee0b71d197.js | 321 ---- ...ts.d67d6757b8cd44bc35b021ee0b71d197.js.map | 1 - .../3.e9348aed5ad228cd3178.js | 1 - .../app-en-GB.518a3d3d068a5eced72e.js | 1 - .../app-fr-FR.091a47ba838c12fe6246.js | 1 - .../app-nl-NL.0be175441213a85f5d2d.js | 1 - .../legacy-multi-index/index-demo.html | 1 - .../legacy-multi-index/index-en-GB.html | 1 - .../legacy-multi-index/index-fr-FR.html | 1 - .../legacy-multi-index/index-nl-NL.html | 1 - .../snapshots/legacy-multi-index/index.html | 1 - .../legacy/3.e9348aed5ad228cd3178.js | 1 - .../legacy/app-en-GB.a45ea0685618e62173e5.js | 1 - .../legacy/app-fr-FR.9d0e25d6b4b7a6a7ce85.js | 1 - .../legacy/app-nl-NL.582236d9bc595f467042.js | 1 - ...ore-js.577a5602a7262d6256830802d4aaab43.js | 12 - ...js.577a5602a7262d6256830802d4aaab43.js.map | 12 - ...dapter.84b300ee818dce8b351c7cc7c100bcf7.js | 10 - ...er.84b300ee818dce8b351c7cc7c100bcf7.js.map | 1 - ...onents.d67d6757b8cd44bc35b021ee0b71d197.js | 321 ---- ...ts.d67d6757b8cd44bc35b021ee0b71d197.js.map | 1 - .../legacy/1.6460eaa1be9cec799f97.js | 1 - .../legacy/app.3a93364ee90208c7ab18.js | 1 - .../test/snapshots/legacy/index.html | 1 - .../legacy/legacy/1.6460eaa1be9cec799f97.js | 1 - .../legacy/legacy/app.dc126e48488aa981a60a.js | 1 - ...ore-js.577a5602a7262d6256830802d4aaab43.js | 12 - ...js.577a5602a7262d6256830802d4aaab43.js.map | 12 - ...dapter.84b300ee818dce8b351c7cc7c100bcf7.js | 10 - ...er.84b300ee818dce8b351c7cc7c100bcf7.js.map | 1 - ...onents.d67d6757b8cd44bc35b021ee0b71d197.js | 321 ---- ...ts.d67d6757b8cd44bc35b021ee0b71d197.js.map | 1 - .../manual-entry/main.24e81bd583ce21f8c464.js | 1 - .../manual-inject/1.6460eaa1be9cec799f97.js | 1 - .../test/snapshots/manual-inject/index.html | 1 - .../main.3a93364ee90208c7ab18.js | 1 - .../multi-entry/2.3033b81b362ac32748c1.js | 1 - .../multi-entry/app.a1512d3b37fc97bcb5b1.js | 1 - .../test/snapshots/multi-entry/index.html | 1 - ...second-entry-point.d631dac68c5b20919b25.js | 1 - .../multi-index/3.e9348aed5ad228cd3178.js | 1 - .../app-en-GB.518a3d3d068a5eced72e.js | 1 - .../app-fr-FR.091a47ba838c12fe6246.js | 1 - .../app-nl-NL.0be175441213a85f5d2d.js | 1 - .../snapshots/multi-index/index-demo.html | 1 - .../snapshots/multi-index/index-en-GB.html | 1 - .../snapshots/multi-index/index-fr-FR.html | 1 - .../snapshots/multi-index/index-nl-NL.html | 1 - .../test/snapshots/multi-index/index.html | 1 - .../1.6460eaa1be9cec799f97.js | 1 - .../app.3a93364ee90208c7ab18.js | 1 - .../snapshots/polyfills-no-hash/index.html | 1 - .../polyfills-no-hash/polyfills/core-js.js | 12 - .../polyfills/core-js.js.map | 12 - .../polyfills/custom-elements-es5-adapter.js | 10 - .../custom-elements-es5-adapter.js.map | 1 - .../polyfills/regenerator-runtime.js | 1 - .../polyfills/regenerator-runtime.js.map | 1 - .../polyfills/webcomponents.js | 321 ---- .../polyfills/webcomponents.js.map | 1 - .../polyfills/1.6460eaa1be9cec799f97.js | 1 - .../polyfills/app.3a93364ee90208c7ab18.js | 1 - .../test/snapshots/polyfills/index.html | 1 - ...ore-js.577a5602a7262d6256830802d4aaab43.js | 12 - ...js.577a5602a7262d6256830802d4aaab43.js.map | 12 - ...dapter.84b300ee818dce8b351c7cc7c100bcf7.js | 10 - ...er.84b300ee818dce8b351c7cc7c100bcf7.js.map | 1 - ...untime.92d44da139046113cb3739b173605787.js | 1 - ...me.92d44da139046113cb3739b173605787.js.map | 1 - ...onents.d67d6757b8cd44bc35b021ee0b71d197.js | 321 ---- ...ts.d67d6757b8cd44bc35b021ee0b71d197.js.map | 1 - .../single-entry/1.6460eaa1be9cec799f97.js | 1 - .../single-entry/app.3a93364ee90208c7ab18.js | 1 - .../test/snapshots/single-entry/index.html | 1 - .../webpack-index-html-plugin.js | 152 -- tsconfig.json | 1 - yarn.lock | 1344 +-------------- 181 files changed, 84 insertions(+), 8498 deletions(-) delete mode 100644 packages/building-webpack/CHANGELOG.md delete mode 100644 packages/building-webpack/demo/js/a/b/import-meta-test-2.js delete mode 100644 packages/building-webpack/demo/js/demo-app.js delete mode 100644 packages/building-webpack/demo/js/demo-component.js delete mode 100644 packages/building-webpack/demo/js/index.html delete mode 100644 packages/building-webpack/demo/js/index.js delete mode 100644 packages/building-webpack/demo/js/lazy-component.js delete mode 100644 packages/building-webpack/demo/js/syntax.js delete mode 100644 packages/building-webpack/demo/js/webpack.config.js delete mode 100644 packages/building-webpack/demo/js/webpack.modern.config.js delete mode 100644 packages/building-webpack/demo/ts-babel/.babelrc delete mode 100644 packages/building-webpack/demo/ts-babel/a/b/import-meta-test-2.ts delete mode 100644 packages/building-webpack/demo/ts-babel/demo-app.ts delete mode 100644 packages/building-webpack/demo/ts-babel/demo-component.ts delete mode 100644 packages/building-webpack/demo/ts-babel/index.html delete mode 100644 packages/building-webpack/demo/ts-babel/index.ts delete mode 100644 packages/building-webpack/demo/ts-babel/lazy-component.ts delete mode 100644 packages/building-webpack/demo/ts-babel/syntax.ts delete mode 100644 packages/building-webpack/demo/ts-babel/webpack.config.js delete mode 100644 packages/building-webpack/demo/ts-babel/webpack.modern.config.js delete mode 100644 packages/building-webpack/index.js delete mode 100644 packages/building-webpack/modern-and-legacy-config.js delete mode 100644 packages/building-webpack/modern-config.js delete mode 100644 packages/building-webpack/package.json delete mode 100644 packages/building-webpack/src/get-default-mode.js delete mode 100644 packages/building-webpack/test/integration.test.js delete mode 100644 packages/webpack-import-meta-loader/.babelrc delete mode 100644 packages/webpack-import-meta-loader/CHANGELOG.md delete mode 100644 packages/webpack-import-meta-loader/LICENSE delete mode 100644 packages/webpack-import-meta-loader/package.json delete mode 100644 packages/webpack-import-meta-loader/src/to-browser-path.js delete mode 100644 packages/webpack-import-meta-loader/test/caseA/index.js delete mode 100644 packages/webpack-import-meta-loader/test/caseA/return.js delete mode 100644 packages/webpack-import-meta-loader/test/caseB/caseBsub/caseBsub.js delete mode 100644 packages/webpack-import-meta-loader/test/caseB/index.js delete mode 100644 packages/webpack-import-meta-loader/test/compiler.js delete mode 100644 packages/webpack-import-meta-loader/test/to-browser-path.test.js delete mode 100644 packages/webpack-import-meta-loader/test/webpack-import-meta-loader.test.js delete mode 100644 packages/webpack-import-meta-loader/webpack-import-meta-loader.js delete mode 100644 packages/webpack-index-html-plugin/CHANGELOG.md delete mode 100644 packages/webpack-index-html-plugin/package.json delete mode 100644 packages/webpack-index-html-plugin/src/create-entrypoints.js delete mode 100644 packages/webpack-index-html-plugin/src/emit-index-html.js delete mode 100644 packages/webpack-index-html-plugin/src/utils.js delete mode 100644 packages/webpack-index-html-plugin/test/custom-polyfills/polyfill-a.js delete mode 100644 packages/webpack-index-html-plugin/test/custom-polyfills/polyfill-b.js delete mode 100644 packages/webpack-index-html-plugin/test/custom-polyfills/polyfill-b.js.map delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/external-loader/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/external-loader/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/external-loader/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/external-loader/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/legacy/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-entry/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-entry/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-entry/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-entry/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-inject/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-inject/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-inject/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/manual-inject/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-entry/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-entry/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-entry/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-entry/second-entry-point.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-entry/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-index/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-index/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-index/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/multi-index/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/polyfills/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/single-entry/app.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/single-entry/index.html delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/single-entry/lazy.js delete mode 100644 packages/webpack-index-html-plugin/test/fixtures/single-entry/webpack.config.js delete mode 100644 packages/webpack-index-html-plugin/test/integration.test.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/app.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/app.dc126e48488aa981a60a.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/loader.24b9b1c6fdcdd67961a536e52578b3fd.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/external-loader/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/3.e9348aed5ad228cd3178.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/app-en-GB.518a3d3d068a5eced72e.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/app-fr-FR.091a47ba838c12fe6246.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/app-nl-NL.0be175441213a85f5d2d.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/index-demo.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/index-en-GB.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/index-fr-FR.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/index-nl-NL.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/legacy/3.e9348aed5ad228cd3178.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/legacy/app-en-GB.a45ea0685618e62173e5.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/legacy/app-fr-FR.9d0e25d6b4b7a6a7ce85.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/legacy/app-nl-NL.582236d9bc595f467042.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy-multi-index/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/app.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/legacy/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/legacy/app.dc126e48488aa981a60a.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/legacy/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/manual-entry/main.24e81bd583ce21f8c464.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/manual-inject/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/manual-inject/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/manual-inject/main.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-entry/2.3033b81b362ac32748c1.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-entry/app.a1512d3b37fc97bcb5b1.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-entry/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-entry/second-entry-point.d631dac68c5b20919b25.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/3.e9348aed5ad228cd3178.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/app-en-GB.518a3d3d068a5eced72e.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/app-fr-FR.091a47ba838c12fe6246.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/app-nl-NL.0be175441213a85f5d2d.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/index-demo.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/index-en-GB.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/index-fr-FR.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/index-nl-NL.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/multi-index/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/app.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/core-js.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/core-js.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/custom-elements-es5-adapter.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/custom-elements-es5-adapter.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/regenerator-runtime.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/regenerator-runtime.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/webcomponents.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills-no-hash/polyfills/webcomponents.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/app.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/index.html delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/core-js.577a5602a7262d6256830802d4aaab43.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/custom-elements-es5-adapter.84b300ee818dce8b351c7cc7c100bcf7.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/regenerator-runtime.92d44da139046113cb3739b173605787.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/regenerator-runtime.92d44da139046113cb3739b173605787.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/polyfills/polyfills/webcomponents.d67d6757b8cd44bc35b021ee0b71d197.js.map delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/single-entry/1.6460eaa1be9cec799f97.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/single-entry/app.3a93364ee90208c7ab18.js delete mode 100644 packages/webpack-index-html-plugin/test/snapshots/single-entry/index.html delete mode 100644 packages/webpack-index-html-plugin/webpack-index-html-plugin.js diff --git a/README.md b/README.md index 5ca2837d..54933ff4 100644 --- a/README.md +++ b/README.md @@ -47,25 +47,23 @@ For more details please visit us at [open-wc.org](https://open-wc.org). ## Packages -| Package | Version | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | -| [building-rollup](./packages/building-rollup) | [![building-rollup](https://img.shields.io/npm/v/@open-wc/building-rollup.svg)](https://www.npmjs.com/package/@open-wc/building-rollup) | Default configuration for working with rollup. | -| [building-webpack](./packages/building-webpack) | [![building-webpack](https://img.shields.io/npm/v/@open-wc/building-webpack.svg)](https://www.npmjs.com/package/@open-wc/building-webpack) | Default configuration for working with webpack. | -| [chai-dom-equals](./packages/chai-dom-equals) | [![chai-dom-equals](https://img.shields.io/npm/v/@open-wc/chai-dom-equals.svg)](https://www.npmjs.com/package/@open-wc/chai-dom-equals) | Chai Plugin to compare dom and shadow dom trees. Part of open-wc recommendations. | -| [create](./packages/create) | [![create](https://img.shields.io/npm/v/@open-wc/create.svg)](https://www.npmjs.com/package/@open-wc/create) | Scaffold web components following open-wc recommendations. | -| [demoing-storybook](./packages/demoing-storybook) | [![demoing-storybook](https://img.shields.io/npm/v/@open-wc/demoing-storybook.svg)](https://www.npmjs.com/package/@open-wc/demoing-storybook) | Storybook configuration following open-wc recommendations. | -| [eslint-config](./packages/eslint-config) | [![eslint-config](https://img.shields.io/npm/v/@open-wc/eslint-config.svg)](https://www.npmjs.com/package/@open-wc/eslint-config) | Eslint configuration following open-wc recommendations. | -| [es-dev-server](./packages/es-dev-server) | [![es-dev-server](https://img.shields.io/npm/v/es-dev-server.svg)](https://www.npmjs.com/package/es-dev-server) | Development server for modern web apps. | -| [polyfills-loader](./packages/polyfills-loader) | [![polyfills-loader](https://img.shields.io/npm/v/@open-wc/polyfills-loader.svg)](https://www.npmjs.com/package/@open-wc/polyfills-loader) | Load web component polyfills using dynamic imports. | -| [prettier-config](./packages/prettier-config) | [![prettier-config](https://img.shields.io/npm/v/@open-wc/prettier-config.svg)](https://www.npmjs.com/package/@open-wc/prettier-config) | Prettier configuration following open-wc recommendations. | -| [scoped-elements](./packages/scoped-elements) | [![scoped-elements](https://img.shields.io/npm/v/@open-wc/scoped-elements.svg)](https://www.npmjs.com/package/@open-wc/scoped-elements) | Auto define custom elements to scope them and avoid the name collision. | -| [semantic-dom-diff](./packages/semantic-dom-diff) | [![semantic-dom-diff](https://img.shields.io/npm/v/@open-wc/semantic-dom-diff.svg)](https://www.npmjs.com/package/@open-wc/semantic-dom-diff) | To compare dom and shadow dom trees. Part of open-wc recommendations. | -| [testing](./packages/testing) | [![testing](https://img.shields.io/npm/v/@open-wc/testing.svg)](https://www.npmjs.com/package/@open-wc/testing) | Testing following open-wc recommendations. | -| [testing-helpers](./packages/testing-helpers) | [![testing-helpers](https://img.shields.io/npm/v/@open-wc/testing-helpers.svg)](https://www.npmjs.com/package/@open-wc/testing-helpers) | Testing Helpers following open-wc recommendations. | -| [testing-karma](./packages/testing-karma) | [![testing-karma](https://img.shields.io/npm/v/@open-wc/testing-karma.svg)](https://www.npmjs.com/package/@open-wc/testing-karma) | Testing with Karma following open-wc recommendations. | -| [testing-karma-bs](./packages/testing-karma-bs) | [![testing-karma-bs](https://img.shields.io/npm/v/@open-wc/testing-karma-bs.svg)](https://www.npmjs.com/package/@open-wc/testing-karma-bs) | Testing with Karma using Browserstack following open-wc recommendations. | -| [testing-wallaby](./packages/testing-wallaby) | [![testing-wallaby](https://img.shields.io/npm/v/@open-wc/testing-wallaby.svg)](https://www.npmjs.com/package/@open-wc/testing-wallaby) | Testing with wallaby following open-wc recommendations. | -| [webpack-import-meta-loader](./packages/webpack-import-meta-loader) | [![webpack-import-meta-loader](https://img.shields.io/npm/v/@open-wc/webpack-import-meta-loader.svg)](https://www.npmjs.com/package/@open-wc/webpack-import-meta-loader) | Webpack loader plugin to support import.meta. | +| Package | Version | Description | +| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| [building-rollup](./packages/building-rollup) | [![building-rollup](https://img.shields.io/npm/v/@open-wc/building-rollup.svg)](https://www.npmjs.com/package/@open-wc/building-rollup) | Default configuration for working with rollup. | +| [chai-dom-equals](./packages/chai-dom-equals) | [![chai-dom-equals](https://img.shields.io/npm/v/@open-wc/chai-dom-equals.svg)](https://www.npmjs.com/package/@open-wc/chai-dom-equals) | Chai Plugin to compare dom and shadow dom trees. Part of open-wc recommendations. | +| [create](./packages/create) | [![create](https://img.shields.io/npm/v/@open-wc/create.svg)](https://www.npmjs.com/package/@open-wc/create) | Scaffold web components following open-wc recommendations. | +| [demoing-storybook](./packages/demoing-storybook) | [![demoing-storybook](https://img.shields.io/npm/v/@open-wc/demoing-storybook.svg)](https://www.npmjs.com/package/@open-wc/demoing-storybook) | Storybook configuration following open-wc recommendations. | +| [eslint-config](./packages/eslint-config) | [![eslint-config](https://img.shields.io/npm/v/@open-wc/eslint-config.svg)](https://www.npmjs.com/package/@open-wc/eslint-config) | Eslint configuration following open-wc recommendations. | +| [es-dev-server](./packages/es-dev-server) | [![es-dev-server](https://img.shields.io/npm/v/es-dev-server.svg)](https://www.npmjs.com/package/es-dev-server) | Development server for modern web apps. | +| [polyfills-loader](./packages/polyfills-loader) | [![polyfills-loader](https://img.shields.io/npm/v/@open-wc/polyfills-loader.svg)](https://www.npmjs.com/package/@open-wc/polyfills-loader) | Load web component polyfills using dynamic imports. | +| [prettier-config](./packages/prettier-config) | [![prettier-config](https://img.shields.io/npm/v/@open-wc/prettier-config.svg)](https://www.npmjs.com/package/@open-wc/prettier-config) | Prettier configuration following open-wc recommendations. | +| [scoped-elements](./packages/scoped-elements) | [![scoped-elements](https://img.shields.io/npm/v/@open-wc/scoped-elements.svg)](https://www.npmjs.com/package/@open-wc/scoped-elements) | Auto define custom elements to scope them and avoid the name collision. | +| [semantic-dom-diff](./packages/semantic-dom-diff) | [![semantic-dom-diff](https://img.shields.io/npm/v/@open-wc/semantic-dom-diff.svg)](https://www.npmjs.com/package/@open-wc/semantic-dom-diff) | To compare dom and shadow dom trees. Part of open-wc recommendations. | +| [testing](./packages/testing) | [![testing](https://img.shields.io/npm/v/@open-wc/testing.svg)](https://www.npmjs.com/package/@open-wc/testing) | Testing following open-wc recommendations. | +| [testing-helpers](./packages/testing-helpers) | [![testing-helpers](https://img.shields.io/npm/v/@open-wc/testing-helpers.svg)](https://www.npmjs.com/package/@open-wc/testing-helpers) | Testing Helpers following open-wc recommendations. | +| [testing-karma](./packages/testing-karma) | [![testing-karma](https://img.shields.io/npm/v/@open-wc/testing-karma.svg)](https://www.npmjs.com/package/@open-wc/testing-karma) | Testing with Karma following open-wc recommendations. | +| [testing-karma-bs](./packages/testing-karma-bs) | [![testing-karma-bs](https://img.shields.io/npm/v/@open-wc/testing-karma-bs.svg)](https://www.npmjs.com/package/@open-wc/testing-karma-bs) | Testing with Karma using Browserstack following open-wc recommendations. | +| [testing-wallaby](./packages/testing-wallaby) | [![testing-wallaby](https://img.shields.io/npm/v/@open-wc/testing-wallaby.svg)](https://www.npmjs.com/package/@open-wc/testing-wallaby) | Testing with wallaby following open-wc recommendations. | ## Contact diff --git a/docs/building/README.md b/docs/building/README.md index f8900911..e6b799c6 100644 --- a/docs/building/README.md +++ b/docs/building/README.md @@ -38,4 +38,4 @@ We are still in the process of investigating and documenting our recommendations ## Webpack -We recommend [rollup](https://rollupjs.org/guide/en/) as a build tool. It is designed specifically for standard es modules and it's very easy to use. But sometimes you are not in control of choosing the tools to use on a project, and you need to make things work with other tools. For webpack, we also have a [standard config](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack) which can be used to build apps with web components. +We recommend [rollup](https://rollupjs.org/guide/en/) as a build tool. It is designed specifically for standard es modules and it's very easy to use. But sometimes you are not in control of choosing the tools to use on a project, and you need to make things work with other tools. For webpack, we have a legacy [standard config](https://github.com/open-wc/legacy/tree/master/packages/building-webpack) which can be used to build apps with web components. diff --git a/packages/building-webpack/CHANGELOG.md b/packages/building-webpack/CHANGELOG.md deleted file mode 100644 index 4ed55d4a..00000000 --- a/packages/building-webpack/CHANGELOG.md +++ /dev/null @@ -1,1459 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.13.46](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.45...@open-wc/building-webpack@2.13.46) (2020-10-11) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.45](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.44...@open-wc/building-webpack@2.13.45) (2020-10-03) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.44](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.43...@open-wc/building-webpack@2.13.44) (2020-10-01) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.43](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.42...@open-wc/building-webpack@2.13.43) (2020-09-25) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.42](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.41...@open-wc/building-webpack@2.13.42) (2020-08-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.41](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.40...@open-wc/building-webpack@2.13.41) (2020-08-19) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.40](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.39...@open-wc/building-webpack@2.13.40) (2020-08-04) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.39](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.38...@open-wc/building-webpack@2.13.39) (2020-07-29) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.38](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.37...@open-wc/building-webpack@2.13.38) (2020-07-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.37](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.36...@open-wc/building-webpack@2.13.37) (2020-07-10) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.36](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.35...@open-wc/building-webpack@2.13.36) (2020-06-25) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.35](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.34...@open-wc/building-webpack@2.13.35) (2020-06-22) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.34](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.33...@open-wc/building-webpack@2.13.34) (2020-06-11) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.33](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.32...@open-wc/building-webpack@2.13.33) (2020-06-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.32](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.31...@open-wc/building-webpack@2.13.32) (2020-05-29) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.31](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.30...@open-wc/building-webpack@2.13.31) (2020-05-25) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.30](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.29...@open-wc/building-webpack@2.13.30) (2020-05-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.29](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.28...@open-wc/building-webpack@2.13.29) (2020-05-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.28](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.27...@open-wc/building-webpack@2.13.28) (2020-05-22) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.27](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.26...@open-wc/building-webpack@2.13.27) (2020-05-21) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.26](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.25...@open-wc/building-webpack@2.13.26) (2020-05-17) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.25](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.24...@open-wc/building-webpack@2.13.25) (2020-05-16) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.24](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.23...@open-wc/building-webpack@2.13.24) (2020-05-16) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.23](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.22...@open-wc/building-webpack@2.13.23) (2020-05-15) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.22](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.21...@open-wc/building-webpack@2.13.22) (2020-05-15) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.21](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.20...@open-wc/building-webpack@2.13.21) (2020-05-14) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.20](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.19...@open-wc/building-webpack@2.13.20) (2020-05-14) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.19](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.18...@open-wc/building-webpack@2.13.19) (2020-05-13) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.18](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.17...@open-wc/building-webpack@2.13.18) (2020-05-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.17](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.16...@open-wc/building-webpack@2.13.17) (2020-05-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.16](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.15...@open-wc/building-webpack@2.13.16) (2020-04-26) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.15](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.14...@open-wc/building-webpack@2.13.15) (2020-04-21) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.14](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.13...@open-wc/building-webpack@2.13.14) (2020-04-20) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.13](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.12...@open-wc/building-webpack@2.13.13) (2020-04-16) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.12](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.11...@open-wc/building-webpack@2.13.12) (2020-04-12) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.11](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.10...@open-wc/building-webpack@2.13.11) (2020-04-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.10](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.9...@open-wc/building-webpack@2.13.10) (2020-03-26) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.9](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.8...@open-wc/building-webpack@2.13.9) (2020-03-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.8](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.7...@open-wc/building-webpack@2.13.8) (2020-03-19) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.7](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.6...@open-wc/building-webpack@2.13.7) (2020-03-15) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.5...@open-wc/building-webpack@2.13.6) (2020-03-15) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.4...@open-wc/building-webpack@2.13.5) (2020-03-11) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.3...@open-wc/building-webpack@2.13.4) (2020-03-10) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.2...@open-wc/building-webpack@2.13.3) (2020-03-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.1...@open-wc/building-webpack@2.13.2) (2020-03-06) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.13.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.13.0...@open-wc/building-webpack@2.13.1) (2020-03-02) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.13.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.12.1...@open-wc/building-webpack@2.13.0) (2020-02-29) - - -### Features - -* **rollup-plugin-html:** first release ([9acb29a](https://github.com/open-wc/open-wc/commit/9acb29ac84b0ef7e2b06c57043c9d2c76d5a29c0)) - - - - - -## [2.12.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.12.0...@open-wc/building-webpack@2.12.1) (2020-02-23) - - -### Bug Fixes - -* **building-webpack:** dont precache legacy files ([38aa31b](https://github.com/open-wc/open-wc/commit/38aa31b108e823557d49d692aacb9396fa4d45ed)) - - - - - -# [2.12.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.6...@open-wc/building-webpack@2.12.0) (2020-02-10) - - -### Features - -* **building-webpack:** support web-modules ([492860a](https://github.com/open-wc/open-wc/commit/492860adbafecacb95378179be950e2e6b2c002d)) - - - - - -## [2.11.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.5...@open-wc/building-webpack@2.11.6) (2020-02-10) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.11.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.4...@open-wc/building-webpack@2.11.5) (2020-02-09) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.11.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.3...@open-wc/building-webpack@2.11.4) (2020-02-09) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.11.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.2...@open-wc/building-webpack@2.11.3) (2020-02-06) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.11.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.1...@open-wc/building-webpack@2.11.2) (2020-02-03) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.11.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.11.0...@open-wc/building-webpack@2.11.1) (2020-02-03) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.11.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.12...@open-wc/building-webpack@2.11.0) (2020-02-02) - - -### Features - -* **building-webpack:** remove extra babel plugins ([5304489](https://github.com/open-wc/open-wc/commit/5304489d3e692473d7b4c20df03e4f8443907f9b)) - - - - - -## [2.10.12](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.11...@open-wc/building-webpack@2.10.12) (2020-01-31) - - -### Bug Fixes - -* skip brooken published versions ([25d21de](https://github.com/open-wc/open-wc/commit/25d21def522f22f98fc8c71b4c055617089c0e23)) - - - - - -## [2.10.11](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.10...@open-wc/building-webpack@2.10.11) (2020-01-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.10](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.9...@open-wc/building-webpack@2.10.10) (2020-01-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.9](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.8...@open-wc/building-webpack@2.10.9) (2020-01-13) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.8](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.7...@open-wc/building-webpack@2.10.8) (2020-01-07) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.7](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.6...@open-wc/building-webpack@2.10.7) (2020-01-06) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.5...@open-wc/building-webpack@2.10.6) (2020-01-03) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.4...@open-wc/building-webpack@2.10.5) (2019-12-30) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.3...@open-wc/building-webpack@2.10.4) (2019-12-30) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.2...@open-wc/building-webpack@2.10.3) (2019-12-30) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.10.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.1...@open-wc/building-webpack@2.10.2) (2019-12-19) - - -### Bug Fixes - -* **building-webpack:** fixes module resolution in config ([a82d75d](https://github.com/open-wc/open-wc/commit/a82d75d1951e937d84d071628bcb6a57b91b3439)) - - - - - -## [2.10.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.10.0...@open-wc/building-webpack@2.10.1) (2019-12-18) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.10.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.9.4...@open-wc/building-webpack@2.10.0) (2019-12-13) - - -### Features - -* **building-webpack:** update version of terser ([f537e47](https://github.com/open-wc/open-wc/commit/f537e475e73b31e81cafbaa920de7ca3f2a05e01)) - - - - - -## [2.9.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.9.3...@open-wc/building-webpack@2.9.4) (2019-12-11) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.9.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.9.2...@open-wc/building-webpack@2.9.3) (2019-12-09) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.9.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.9.1...@open-wc/building-webpack@2.9.2) (2019-12-09) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.9.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.9.0...@open-wc/building-webpack@2.9.1) (2019-12-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.9.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.9...@open-wc/building-webpack@2.9.0) (2019-12-08) - - -### Features - -* **building-webpack:** support optional chaining and nullish coalescing ([2e5fac9](https://github.com/open-wc/open-wc/commit/2e5fac99484004ff048e07c5843ec15dc165fa2b)) - - - - - -## [2.8.9](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.8...@open-wc/building-webpack@2.8.9) (2019-12-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.8](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.7...@open-wc/building-webpack@2.8.8) (2019-12-05) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.7](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.6...@open-wc/building-webpack@2.8.7) (2019-12-02) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.5...@open-wc/building-webpack@2.8.6) (2019-12-01) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.4...@open-wc/building-webpack@2.8.5) (2019-11-30) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.3...@open-wc/building-webpack@2.8.4) (2019-11-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.2...@open-wc/building-webpack@2.8.3) (2019-11-27) - - -### Bug Fixes - -* **building-webpack:** maintain whitespace with "conservativeCollapse" ([d3eff0b](https://github.com/open-wc/open-wc/commit/d3eff0bea1f7710407db7da47f4d3bdbb959a272)) - - - - - -## [2.8.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.1...@open-wc/building-webpack@2.8.2) (2019-11-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.8.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.8.0...@open-wc/building-webpack@2.8.1) (2019-11-20) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.8.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.7.4...@open-wc/building-webpack@2.8.0) (2019-11-19) - - -### Features - -* update to use auto compatibility of es-dev-server ([f6d085e](https://github.com/open-wc/open-wc/commit/f6d085eda5a05391d1a464b9e49222c78194b0d9)) - - - - - -## [2.7.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.7.3...@open-wc/building-webpack@2.7.4) (2019-11-03) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.7.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.7.2...@open-wc/building-webpack@2.7.3) (2019-10-25) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.7.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.7.1...@open-wc/building-webpack@2.7.2) (2019-10-23) - - -### Bug Fixes - -* add package keywords ([#859](https://github.com/open-wc/open-wc/issues/859)) ([cd78405](https://github.com/open-wc/open-wc/commit/cd78405)) - - - - - -## [2.7.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.7.0...@open-wc/building-webpack@2.7.1) (2019-10-22) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.7.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.6.3...@open-wc/building-webpack@2.7.0) (2019-10-16) - - -### Features - -* **building-webpack:** add workbox to webpack conf ([#865](https://github.com/open-wc/open-wc/issues/865)) ([34f021d](https://github.com/open-wc/open-wc/commit/34f021d)) - - - - - -## [2.6.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.6.2...@open-wc/building-webpack@2.6.3) (2019-09-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.6.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.6.1...@open-wc/building-webpack@2.6.2) (2019-09-22) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.6.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.6.0...@open-wc/building-webpack@2.6.1) (2019-09-11) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.6.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.8...@open-wc/building-webpack@2.6.0) (2019-08-27) - - -### Features - -* **building-webpack:** always clean output dir once ([8e8a3b6](https://github.com/open-wc/open-wc/commit/8e8a3b6)) -* **building-webpack:** always generate cheap module source maps ([23f8ef8](https://github.com/open-wc/open-wc/commit/23f8ef8)) -* **building-webpack:** optimize chunk output filenames ([bb95f0d](https://github.com/open-wc/open-wc/commit/bb95f0d)) - - - - - -## [2.5.8](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.7...@open-wc/building-webpack@2.5.8) (2019-08-26) - - -### Bug Fixes - -* **building-webpack:** always multi-build in dev mode ([#760](https://github.com/open-wc/open-wc/issues/760)) ([221a6c0](https://github.com/open-wc/open-wc/commit/221a6c0)) - - - - - -## [2.5.7](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.6...@open-wc/building-webpack@2.5.7) (2019-08-21) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.5...@open-wc/building-webpack@2.5.6) (2019-08-20) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.4...@open-wc/building-webpack@2.5.5) (2019-08-18) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.3...@open-wc/building-webpack@2.5.4) (2019-08-14) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.2...@open-wc/building-webpack@2.5.3) (2019-08-13) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.1...@open-wc/building-webpack@2.5.2) (2019-08-13) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.5.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.5.0...@open-wc/building-webpack@2.5.1) (2019-08-08) - - -### Bug Fixes - -* **building-webpack:** use standard webpack mode argument style ([#705](https://github.com/open-wc/open-wc/issues/705)) ([abaad60](https://github.com/open-wc/open-wc/commit/abaad60)) - - - - - -# [2.5.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.4.4...@open-wc/building-webpack@2.5.0) (2019-08-08) - - -### Features - -* **building-webpack:** allow overriding mode through config ([#700](https://github.com/open-wc/open-wc/issues/700)) ([f2cc64c](https://github.com/open-wc/open-wc/commit/f2cc64c)) - - - - - -## [2.4.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.4.3...@open-wc/building-webpack@2.4.4) (2019-08-05) - - -### Bug Fixes - -* cleanup package.json scripts ([be6bdb5](https://github.com/open-wc/open-wc/commit/be6bdb5)) - - - - - -## [2.4.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.4.2...@open-wc/building-webpack@2.4.3) (2019-08-04) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.4.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.4.1...@open-wc/building-webpack@2.4.2) (2019-07-26) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.4.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.4.0...@open-wc/building-webpack@2.4.1) (2019-07-24) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.4.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.3.4...@open-wc/building-webpack@2.4.0) (2019-07-24) - - -### Features - -* **building-webpack:** add main entry point ([00457b5](https://github.com/open-wc/open-wc/commit/00457b5)) - - - - - -## [2.3.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.3.3...@open-wc/building-webpack@2.3.4) (2019-07-22) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.3.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.3.2...@open-wc/building-webpack@2.3.3) (2019-07-19) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.3.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.3.1...@open-wc/building-webpack@2.3.2) (2019-07-15) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.3.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.3.0...@open-wc/building-webpack@2.3.1) (2019-07-13) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.3.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.5...@open-wc/building-webpack@2.3.0) (2019-07-12) - - -### Features - -* **create:** switch from owc-dev-server to es-dev-server ([#571](https://github.com/open-wc/open-wc/issues/571)) ([97a80d1](https://github.com/open-wc/open-wc/commit/97a80d1)) - - - - - -## [2.2.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.4...@open-wc/building-webpack@2.2.5) (2019-07-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.2.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.3...@open-wc/building-webpack@2.2.4) (2019-07-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.2.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.2...@open-wc/building-webpack@2.2.3) (2019-07-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.2.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.1...@open-wc/building-webpack@2.2.2) (2019-07-02) - - -### Bug Fixes - -* only depend on polyfills in building-utils ([2568cdc](https://github.com/open-wc/open-wc/commit/2568cdc)) - - - - - -## [2.2.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.2.0...@open-wc/building-webpack@2.2.1) (2019-07-02) - - -### Bug Fixes - -* **building-webpack:** always export an array of configs ([0eaff97](https://github.com/open-wc/open-wc/commit/0eaff97)) - - - - - -# [2.2.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.1.2...@open-wc/building-webpack@2.2.0) (2019-07-02) - - -### Features - -* add es dev server ([2c6a0a8](https://github.com/open-wc/open-wc/commit/2c6a0a8)) - - - - - -## [2.1.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.1.1...@open-wc/building-webpack@2.1.2) (2019-06-30) - - -### Bug Fixes - -* **webpack-index-html-plugin:** multi build now works on windows ([#522](https://github.com/open-wc/open-wc/issues/522)) ([b24723a](https://github.com/open-wc/open-wc/commit/b24723a)) - - - - - -## [2.1.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.1.0...@open-wc/building-webpack@2.1.1) (2019-06-23) - - -### Bug Fixes - -* add missing dependencies ([9abf373](https://github.com/open-wc/open-wc/commit/9abf373)) - - - - - -# [2.1.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.0.3...@open-wc/building-webpack@2.1.0) (2019-06-23) - - -### Features - -* **building-rollup:** add rollup-index-html-plugin ([#510](https://github.com/open-wc/open-wc/issues/510)) ([2ac2d19](https://github.com/open-wc/open-wc/commit/2ac2d19)) - - - - - -## [2.0.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.0.2...@open-wc/building-webpack@2.0.3) (2019-06-18) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [2.0.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.0.1...@open-wc/building-webpack@2.0.2) (2019-06-14) - - -### Bug Fixes - -* align scripts and update create ([#494](https://github.com/open-wc/open-wc/issues/494)) ([96b62c7](https://github.com/open-wc/open-wc/commit/96b62c7)) - - - - - -## [2.0.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@2.0.0...@open-wc/building-webpack@2.0.1) (2019-06-14) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -# [2.0.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.5...@open-wc/building-webpack@2.0.0) (2019-06-14) - - -### Features - -* utils and webpack plugin for an index.html entrypoint ([#474](https://github.com/open-wc/open-wc/issues/474)) ([c382cc7](https://github.com/open-wc/open-wc/commit/c382cc7)) - - -### BREAKING CHANGES - -* Replaced webpack html plugin with index html plugin - - - - - -## [1.4.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.4...@open-wc/building-webpack@1.4.5) (2019-05-30) - - -### Bug Fixes - -* **building-webpack:** html race condition ([10c22ab](https://github.com/open-wc/open-wc/commit/10c22ab)) - - - - - -## [1.4.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.3...@open-wc/building-webpack@1.4.4) (2019-05-25) - - -### Bug Fixes - -* **building-webpack:** minify CSS properly ([81fe2c2](https://github.com/open-wc/open-wc/commit/81fe2c2)) - - - - - -## [1.4.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.2...@open-wc/building-webpack@1.4.3) (2019-05-19) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [1.4.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.1...@open-wc/building-webpack@1.4.2) (2019-05-18) - - -### Bug Fixes - -* **building-rollup:** update to babel-plugin-template-html-minifier ([690952e](https://github.com/open-wc/open-wc/commit/690952e)) - - - - - -## [1.4.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.4.0...@open-wc/building-webpack@1.4.1) (2019-05-11) - - -### Bug Fixes - -* recommend putting index.html into the root folder ([b943f53](https://github.com/open-wc/open-wc/commit/b943f53)) - - - - - -# [1.4.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.6...@open-wc/building-webpack@1.4.0) (2019-05-07) - - -### Features - -* **building-webpack:** use a default browserslist ([76c03c7](https://github.com/open-wc/open-wc/commit/76c03c7)) - - - - - -## [1.3.6](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.5...@open-wc/building-webpack@1.3.6) (2019-05-06) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [1.3.5](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.4...@open-wc/building-webpack@1.3.5) (2019-04-30) - - -### Bug Fixes - -* **building-webpack:** Solve issue where preload links had comma's between them. ([#411](https://github.com/open-wc/open-wc/issues/411)) ([6bdf529](https://github.com/open-wc/open-wc/commit/6bdf529)) - - - - - -## [1.3.4](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.3...@open-wc/building-webpack@1.3.4) (2019-04-23) - - -### Bug Fixes - -* **building-webpack:** correct manual install steps ([50531ff](https://github.com/open-wc/open-wc/commit/50531ff)) - - - - - -## [1.3.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.2...@open-wc/building-webpack@1.3.3) (2019-04-14) - - -### Bug Fixes - -* update generator usage ([5d284d4](https://github.com/open-wc/open-wc/commit/5d284d4)) - - - - - -## [1.3.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.1...@open-wc/building-webpack@1.3.2) (2019-04-14) - - -### Bug Fixes - -* **building-webpack:** fix incorrect dev server warning ([f52fa3f](https://github.com/open-wc/open-wc/commit/f52fa3f)) -* **building-webpack:** preserve casing when minifying html templates ([54dbca8](https://github.com/open-wc/open-wc/commit/54dbca8)) - - - - - -## [1.3.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.3.0...@open-wc/building-webpack@1.3.1) (2019-04-13) - - -### Bug Fixes - -* **building-webpack:** add decorator friendly .babelrc example ([211653b](https://github.com/open-wc/open-wc/commit/211653b)) - - - - - -# [1.3.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.2.3...@open-wc/building-webpack@1.3.0) (2019-04-06) - - -### Features - -* **building-webpack:** make custom webpack plugin public ([#355](https://github.com/open-wc/open-wc/issues/355)) ([f3d291a](https://github.com/open-wc/open-wc/commit/f3d291a)) - - - - - -## [1.2.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.2.2...@open-wc/building-webpack@1.2.3) (2019-04-05) - - -### Bug Fixes - -* do not assume available global types of users ([cd394d9](https://github.com/open-wc/open-wc/commit/cd394d9)) - - - - - -## [1.2.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.2.1...@open-wc/building-webpack@1.2.2) (2019-04-03) - - -### Bug Fixes - -* add clone dependency ([4d15a39](https://github.com/open-wc/open-wc/commit/4d15a39)) - - - - - -## [1.2.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.2.0...@open-wc/building-webpack@1.2.1) (2019-04-03) - - -### Bug Fixes - -* **building-webpack:** add dom5 fork to npm package ([fcb26fd](https://github.com/open-wc/open-wc/commit/fcb26fd)) - - - - - -# [1.2.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.1.3...@open-wc/building-webpack@1.2.0) (2019-04-03) - - -### Features - -* **building-webpack:** enable single entry point html file ([71e5650](https://github.com/open-wc/open-wc/commit/71e5650)) - - - - - -## [1.1.3](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.1.2...@open-wc/building-webpack@1.1.3) (2019-04-02) - - -### Bug Fixes - -* **building-webpack:** support windows file pathes as well ([#344](https://github.com/open-wc/open-wc/issues/344)) ([cca6eae](https://github.com/open-wc/open-wc/commit/cca6eae)) - - - - - -## [1.1.2](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.1.1...@open-wc/building-webpack@1.1.2) (2019-03-30) - - -### Bug Fixes - -* **building-webpack:** allow to provide a publicPath ([2f54a78](https://github.com/open-wc/open-wc/commit/2f54a78)) - - - - - -## [1.1.1](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.1.0...@open-wc/building-webpack@1.1.1) (2019-03-27) - - -### Bug Fixes - -* **building-webpack:** default webpack generator config and docs ([#321](https://github.com/open-wc/open-wc/issues/321)) ([c4f37a6](https://github.com/open-wc/open-wc/commit/c4f37a6)) - - - - - -# [1.1.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@1.0.0...@open-wc/building-webpack@1.1.0) (2019-03-23) - - -### Features - -* add types + linting & improve intellisense ([b6d260c](https://github.com/open-wc/open-wc/commit/b6d260c)) - - - - - -# [1.0.0](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@0.1.10...@open-wc/building-webpack@1.0.0) (2019-03-21) - - -### Features - -* **building-webpack:** update building webpack ([a0925f2](https://github.com/open-wc/open-wc/commit/a0925f2)) - - -### BREAKING CHANGES - -* **building-webpack:** config API and names changed - -* chore(building-webpack): add copy webpack plugin to all demos - -* Update packages/building-webpack/package.json - -Co-Authored-By: LarsDenBakker - -* Update packages/building-webpack/package.json - -Co-Authored-By: LarsDenBakker - -* Update packages/building-webpack/package.json - -Co-Authored-By: LarsDenBakker - - - - - -## [0.1.10](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@0.1.9...@open-wc/building-webpack@0.1.10) (2019-03-08) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [0.1.9](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@0.1.8...@open-wc/building-webpack@0.1.9) (2019-02-18) - - -### Bug Fixes - -* bump versions of lit-html and lit-element to 1.0.x stable releases ([32c5bd8](https://github.com/open-wc/open-wc/commit/32c5bd8)) - - - - - -## [0.1.8](https://github.com/open-wc/open-wc/compare/@open-wc/building-webpack@0.1.7...@open-wc/building-webpack@0.1.8) (2019-02-16) - - -### Bug Fixes - -* update package repository fields with monorepo details ([cb1acb7](https://github.com/open-wc/open-wc/commit/cb1acb7)) - - - - - -## [0.1.7](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.6...@open-wc/building-webpack@0.1.7) (2019-02-03) - - -### Bug Fixes - -* **building-webpack:** improve setup docu to minify user errors ([3835e73](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/3835e73)) - - - - - -## [0.1.6](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.5...@open-wc/building-webpack@0.1.6) (2019-02-03) - - -### Bug Fixes - -* **building-webpack:** defaultOptions indexJS is not an array ([db69557](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/db69557)) - - - - - -## [0.1.5](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.4...@open-wc/building-webpack@0.1.5) (2019-02-02) - - -### Bug Fixes - -* unify npm readme header for all open-wc packages ([1bac939](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/1bac939)) - - - - - -## [0.1.4](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.3...@open-wc/building-webpack@0.1.4) (2019-01-30) - - -### Bug Fixes - -* **building-webpack:** remove comments on build ([b46a2a8](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/b46a2a8)) - - - - - -## [0.1.3](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.2...@open-wc/building-webpack@0.1.3) (2019-01-27) - - -### Bug Fixes - -* improve documentation ([ddf9cd2](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/ddf9cd2)) - - - - - -## [0.1.2](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.1...@open-wc/building-webpack@0.1.2) (2019-01-27) - -**Note:** Version bump only for package @open-wc/building-webpack - - - - - -## [0.1.1](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/compare/@open-wc/building-webpack@0.1.0...@open-wc/building-webpack@0.1.1) (2019-01-26) - - -### Bug Fixes - -* align all open-wc readme headers ([b589429](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/b589429)) - - - - - -# 0.1.0 (2019-01-26) - - -### Features - -* add building-webpack ([18d33fc](https://github.com/open-wc/open-wc/tree/master/packages/building-webpack/commit/18d33fc)) diff --git a/packages/building-webpack/README.md b/packages/building-webpack/README.md index a7501d4b..f32bc10b 100644 --- a/packages/building-webpack/README.md +++ b/packages/building-webpack/README.md @@ -1,416 +1 @@ -# Webpack - -Webpack configuration to help you get started building modern web applications. You write modern javascript using the latest browser features, webpack will optimize your code for production ensure it runs on all supported browsers. - -[//]: # 'AUTO INSERT HEADER PREPUBLISH' - -## Configuration - -The input for webpack is the same `index.html` you use for development. Any module scripts in your index are run through webpack and your index is updated with the output from rollup. - -See 'config features' for all details. See the extending section for customization, such as supporting non-standard syntax or adding babel plugins. - -## Setup - -### New project - -```bash -npm init @open-wc -``` - -### Existing project - -```bash -npm init @open-wc -# Upgrade > Building > Webpack -``` - -### Manual setup - -1. Install the required dependencies: - -```bash -npm i -D @open-wc/building-webpack webpack webpack-cli es-dev-server -``` - -2. Create a file called `webpack.config.js` and pass in your app's js entry point and index.html. Pick the config you need below: - -```javascript -const path = require('path'); -const { createDefaultConfig } = require('@open-wc/building-webpack'); - -// if you need to support IE11 use `createCompatibilityConfig` instead. -// const { createCompatibilityConfig } = require('@open-wc/building-webpack'); -// module.exports = createCompatibilityConfig({ -// input: path.resolve(__dirname, './index.html'), -// }); - -module.exports = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), -}); -``` - -3. Create an `index.html`: - -```html - - - - - - - - - -``` - -We use [webpack-index-html-plugin](https://github.com/open-wc/open-wc/tree/master/packages/webpack-index-html-plugin). Contrary to other webpack plugins, you **do** need to include your app's module entrypoint in your `index.html`. This allows you to use the same index during development and when building. - -4. Add the following commands to your `package.json`: - -```json -{ - "scripts": { - "build": "webpack --mode production", - "start:build": "es-dev-server --app-index dist/index.html --open" - } -} -``` - -- `start` runs your app for development, reloading on file changes -- `start:build` runs your app after it has been built using the build command -- `build` builds your app and outputs it in your `dist` directory - -## Browser support - -`createDefaultConfig` creates a single build of your app for modern browsers (by default last 2 of major browsers). This is recommended if you only need to support modern browsers, otherwise you will need to ship compatibility code for browsers which don't need it. - -`createCompatibilityConfig` creates two builds of your app. A modern build like the above, and a legacy build for IE11. Additional code is injected to load polyfills and the correct version of your app. This is recommended if you need to support IE11. - -## Config features - -All configs: - -- resolve bare imports (`import { html } from 'lit-html'`) -- preserve `import.meta.url` value from before bundling -- minify + treeshake js -- minify html and css in template literals - -`createDefaultConfig`: - -- single build output -- compatible with any browser which supports Web Components - -`createCompatibilityConfig`: - -- Two build outputs: - - Modern: - - compatible with modern browsers (default: last 2 chrome, firefox safari and edge) - - does not penalize users with modern browser with compatibility code for IE11 - - Legacy: - - compatible down to IE11 - - babel transform down to IE11 (es5) - - core js babel polyfills (`Array.from`, `String.prototype.includes` etc.) - - webcomponentsjs polyfills - - URL polyfill - - fetch polyfill - -See below for more configuration options. - -## Customizing the babel config - -You can define your own babel plugins by adding a `.babelrc` or `babel.config.js` to your project. See [babeljs config](https://babeljs.io/docs/en/configuration) for more information. - -For example to add support for class properties: - -```json -{ - "plugins": ["@babel/plugin-proposal-class-properties"] -} -``` - -## Adjusting browser support for the modern build - -The legacy build targets IE11, which is the earliest browser supported by the webcomponents polyfill. For the modern build we target the lates 2 versions of the major browsers (chrome, firefox, safari and edge). - -You can adjust this by adding a [browserslist](https://github.com/browserslist/browserslist) configuration. For example by adding a `.browserslistrc` file to your project, or adding an entry to your package.json. See the [browserslist documentation](https://github.com/browserslist/browserslist) for more information. - -> Note: you should not add IE11 or other very early browsers as a target in your browserslist, as it would result in a broken modern build because it makes some assumptions around browser support. Use the `--legacy` flag for legacy builds. - -## Extending the webpack config - -A webpack config is an object. To extend it, we recommend using `webpack-merge` to ensure plugins are merged correctly. For example to adjust the output folder: - -```javascript -const merge = require('webpack-merge'); -const { createDefaultConfig } = require('@open-wc/building-webpack'); - -const config = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -module.exports = merge(config, { - output: { - path: 'build', - }, -}); -``` - -If you use `createCompatibilityConfig`, it is actually an array of configs so that webpack outputs a modern and a legacy build. Simply map over the array to adjust both configs: - -```javascript -const merge = require('webpack-merge'); -const { createCompatibilityConfig } = require('@open-wc/building-webpack'); - -const configs = createCompatibilityConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -module.exports = configs.map(config => - merge(config, { - output: { - path: 'build', - }, - }), -); -``` - -### Common extensions - -::: warning -Some extensions or plugins add non-native or experimental features to your code. This can be bad for the maintenance of your code in the long term, we therefore don't recommend it unless you know what you're doing. -::: - -#### Customizing index.html output - -If you need to customize the output of your `index.html` you can pass extra options to [webpack-index-html-plugin](https://github.com/open-wc/open-wc/tree/master/packages/webpack-index-html-plugin): - -```javascript -const merge = require('webpack-merge'); -const { createDefaultConfig } = require('@open-wc/building-webpack'); - -module.exports = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), - webpackIndexHTMLPlugin: { - polyfills: { - fetch: false, - intersectionObserver: true, - }, - }, -}); -``` - -See the documentation for all options. - -#### non index.html entrypoint - -By default we look for an `index.html` as entrypoint. If want to use regular entrypoints you will need to provide your `index.html` for output manually: - -```javascript -const merge = require('webpack-merge'); -const { createDefaultConfig } = require('@open-wc/building-webpack'); - -module.exports = createDefaultConfig({ - input: path.resolve(__dirname, './my-app.js'), - webpackIndexHTMLPlugin: { - template: ({ assets, entries, legacyEntries, variation }) => ` - - - - - `, - }, -}); -``` - -#### Adding or removing polyfills - -By default we polyfill `core-js`, `webcomponentsjs` and `fetch`. It is possile to add or remove polyfills by passing `webpack-index-html` configuration like above: - -```javascript -const merge = require('webpack-merge'); -const { createDefaultConfig } = require('@open-wc/building-webpack'); - -module.exports = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), - webpackIndexHTMLPlugin: { - polyfills: { - fetch: false, - intersectionObserver: true, - customPolyfills: [ - { - name: 'my-feature', - test: "'myFeature' in window", - path: require.resolve('my-feature-polyfill/dist/bundled.js'), - }, - ], - }, - }, -}); -``` - -[See the documentation](https://github.com/open-wc/open-wc/tree/master/packages/webpack-index-html-plugin) for more information. - -#### Copy assets - -Web apps often include assets such as css files and images. These are not part of your regular dependency graph, so they need to be copied into the build directory. - -[copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) is a popular plugin fo this. - -```javascript -const path = require('path'); -const merge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const { createCompatibilityConfig } = require('@open-wc/building-webpack'); - -const configs = createCompatibilityConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -// with modern-and-legacy-config, the config is actually an array of configs for a modern and -// a legacy build. We don't need to copy files twice, so we aadd the copy job only to the first -// config -module.exports = [ - // add plugin to the first config - merge(configs[0], { - plugins: [new CopyWebpackPlugin(['images/**/*.png'])], - }), - - // the second config left untouched - configs[1], -]; -``` - -#### Support typescript - -Make sure to prevent any compilation done by the typescript compiler `tsconfig.json`, as babel and webpack do this for you: - -```json -{ - "compilerOptions": { - "target": "ESNEXT", - "module": "ESNext" - } -} -``` - -Within webpack there are two options to add typescript support. - -##### 1. Babel - -We recommend using the babel typescript plugin. Add this to your `.babelrc`: - -```json -{ - "presets": ["@babel/preset-typescript"] -} -``` - -This the fastest method, as it strips away types during babel transformormation of your code. It will not perform any type checking though. We recommend setting up the type checking as part of your linting setup, so that you don't need to run the typechecker during development for faster builds. - -
- Supporting decorators - -::: warning -Please note that decorators will add [non standard syntax](#common-extensions) to your code. -::: - -```json -{ - "presets": ["@babel/preset-typescript"], - // for libraries that support babel decorators (lit-element) use: - "plugins": [ - ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], - "@babel/plugin-proposal-class-properties" - ] - // for libraries that only support typescript: - // "plugins": [ - // ["@babel/plugin-proposal-decorators", { "legacy": true }], - // ["@babel/plugin-proposal-class-properties", { "loose": true }] - // ], -} -``` - -
- -##### 2. Plugin - -It is also possible to add the webpack typescript plugin, which does typechecking and compiling for you: - -```javascript -const path = require('path'); -const merge = require('webpack-merge'); -const { createCompatibilityConfig } = require('@open-wc/building-webpack'); - -const configs = createCompatibilityConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -module.exports = configs.map(config => - merge(config, { - module: { - rules: [{ test: /\.ts$/, loader: 'ts-loader' }], - }, - }), -); -``` - -## Progressive Web App - -### Making your app installable - -Make sure your PWA meets the installable criteria, which you can find [here](https://developers.google.com/web/fundamentals/app-install-banners/). You can find a tool to generate your `manifest.json` [here](https://www.pwabuilder.com/generate). When your app has a service worker with a `fetch` handler (generated by this configuration), a `manifest.json`, and is served over HTTPS, your app is ready to be installed. - -### Enabling the service worker - -This configuration will by default generate a service worker for you, using [workbox-webpack-plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin). The service worker will only be generated for production. To opt-in to using this service worker, you can add the following code snippet to your `index.html`: - -```html - -``` - -### Overriding the workbox config - -If you want to override the default config with your own workbox configuration, you can disable the default workbox configuration by setting `options.plugins.workbox` to false in the `options` object that you pass to `createBasicConfig`, and then you can override the plugins - -```js -const merge = require('deepmerge'); -const { InjectManifest } = require('workbox-webpack-plugin'); -const createDefaultConfig = require('@open-wc/building-webpack'); - -const defaultConfig = createDefaultConfig({ - plugins: { - workbox: false, - }, -}); - -module.exports = merge(defaultConfig, { - plugins: [new InjectManifest(/* */)], -}); -``` - -You can find the options for configuring Workbox [here](https://developers.google.com/web/tools/workbox/modules/workbox-build). - -### Disabling service worker generation - -To opt out of using workbox to generate a service worker, you can disabled it by overriding the options in the `createBasicConfig` function: - -```js -module.exports = createBasicConfig({ - plugins: { - workbox: false, - }, -}); -``` - -### A note on `skipWaiting` - -By default, the service worker generated will _not_ call `skipWaiting`. The reason for this is that it becomes very painful very quickly if you're lazyloading code in your application. - -If you want to add a user-friendly 'Add To Home Screen' experience, you can use the [pwa-update-available](https://github.com/thepassle/pwa-helpers) web component. +I moved into the legacy repository [building-webpack](https://github.com/open-wc/legacy/tree/master/packages/building-webpack) we now recommend rollup over webpack. diff --git a/packages/building-webpack/demo/js/a/b/import-meta-test-2.js b/packages/building-webpack/demo/js/a/b/import-meta-test-2.js deleted file mode 100644 index 0f4299b0..00000000 --- a/packages/building-webpack/demo/js/a/b/import-meta-test-2.js +++ /dev/null @@ -1,3 +0,0 @@ -window.__importMeta2 = - import.meta.url.startsWith(window.location.origin) && - import.meta.url.endsWith('/a/b/import-meta-test-2.js'); diff --git a/packages/building-webpack/demo/js/demo-app.js b/packages/building-webpack/demo/js/demo-app.js deleted file mode 100644 index 157bc2d9..00000000 --- a/packages/building-webpack/demo/js/demo-app.js +++ /dev/null @@ -1,54 +0,0 @@ -import { LitElement, html, css } from 'lit-element'; -import './demo-component.js'; - -// partial css trips up the minifier -const fontSize = css` - 16 -`; - -const fontMd = css` - font-size: ${fontSize}px; -`; - -class DemoApp extends LitElement { - static get styles() { - return css` - :host { - display: block; - color: black; - background-color: white; - ${fontMd} - } - `; - } - - render() { - return html` -

Demo app

- - - `; - } -} - -customElements.define('demo-app', DemoApp); - -const cssText = DemoApp.styles.cssText.replace(/\s/g, ''); -const foo = { bar: 'lorem ipsum' }; -const loremIpsum = undefined; - -window.__optionalChaining = foo?.bar === 'lorem ipsum' && foo?.bar?.loremIpsum === undefined; -window.__nullishCoalescing = (loremIpsum ?? 'lorem ipsum') === 'lorem ipsum'; -window.__partialCSS = cssText.includes('font-size:16px') && cssText.includes('display:block'); -window.__litElement = (async () => { - await import('./lazy-component.js'); - const app = document.body.querySelector('demo-app'); - const demoComponent = app.shadowRoot.querySelector('demo-component'); - const lazyComponent = app.shadowRoot.querySelector('lazy-component'); - - return ( - app.shadowRoot.innerHTML.includes('

Demo app

') && - demoComponent.shadowRoot.innerHTML.includes('

Demo component

') && - lazyComponent.shadowRoot.innerHTML.includes('

Lazy component

') - ); -})(); diff --git a/packages/building-webpack/demo/js/demo-component.js b/packages/building-webpack/demo/js/demo-component.js deleted file mode 100644 index 97bfdc6a..00000000 --- a/packages/building-webpack/demo/js/demo-component.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable class-methods-use-this, import/no-extraneous-dependencies */ -import { LitElement, html, css } from 'lit-element'; - -class DemoComponent extends LitElement { - static get styles() { - return css` - p { - color: blue; - } - `; - } - - render() { - return html`

Demo component

`; - } -} - -customElements.define('demo-component', DemoComponent); diff --git a/packages/building-webpack/demo/js/index.html b/packages/building-webpack/demo/js/index.html deleted file mode 100644 index 718fee3f..00000000 --- a/packages/building-webpack/demo/js/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - My Demo - - - - -

Static content in index.html is preserved

- - - -
- - - - - \ No newline at end of file diff --git a/packages/building-webpack/demo/js/index.js b/packages/building-webpack/demo/js/index.js deleted file mode 100644 index 450feada..00000000 --- a/packages/building-webpack/demo/js/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import './demo-app.js'; -import './syntax.js'; - -(async () => { - window.__tests = { - partialCSS: window.__partialCSS || false, - litElement: (await window.__litElement) || false, - startsWith: window.__startsWith || false, - map: window.__map || false, - importMeta: window.__importMeta || false, - importMeta2: window.__importMeta2 || false, - asyncFunction: (await window.__asyncFunction) || false, - forOf: window.__forOf || false, - optionalChaining: window.__optionalChaining || false, - nullishCoalescing: window.__nullishCoalescing || false, - }; - document.getElementById('test').innerHTML = `
${JSON.stringify(
-    window.__tests,
-    null,
-    2,
-  )}
`; -})(); diff --git a/packages/building-webpack/demo/js/lazy-component.js b/packages/building-webpack/demo/js/lazy-component.js deleted file mode 100644 index 25eff371..00000000 --- a/packages/building-webpack/demo/js/lazy-component.js +++ /dev/null @@ -1,17 +0,0 @@ -import { LitElement, html, css } from 'lit-element'; - -class LazyComponent extends LitElement { - static get styles() { - return css` - p { - color: red; - } - `; - } - - render() { - return html`

Lazy component

`; - } -} - -customElements.define('lazy-component', LazyComponent); diff --git a/packages/building-webpack/demo/js/syntax.js b/packages/building-webpack/demo/js/syntax.js deleted file mode 100644 index 14b0dcbb..00000000 --- a/packages/building-webpack/demo/js/syntax.js +++ /dev/null @@ -1,27 +0,0 @@ -import './a/b/import-meta-test-2.js'; - -async function asyncFunction() { - await new Promise(resolve => setTimeout(resolve, 1)); - return true; -} - -function forOf() { - const map = new Map(); - map.set('a', 1); - map.set('2', 2); - let total = 0; - for (const [k, v] of map) { - total += v; - } - return total; -} - -console.log('async function compiled to: ', asyncFunction.toString()); -console.log('forOf function compiled to: ', forOf.toString()); - -window.__startsWith = 'foo'.startsWith('fo'); -window.__map = new Map().set('foo', 'bar').get('foo') === 'bar'; -window.__importMeta = - import.meta.url.startsWith(window.location.origin) && import.meta.url.endsWith('syntax.js'); -window.__asyncFunction = asyncFunction(); -window.__forOf = forOf() === 3; diff --git a/packages/building-webpack/demo/js/webpack.config.js b/packages/building-webpack/demo/js/webpack.config.js deleted file mode 100644 index 45f8d118..00000000 --- a/packages/building-webpack/demo/js/webpack.config.js +++ /dev/null @@ -1,19 +0,0 @@ -const path = require('path'); -const merge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const createDefaultConfigs = require('../../modern-and-legacy-config'); - -const configs = createDefaultConfigs({ - input: path.resolve(__dirname, './index.html'), -}); - -if (Array.isArray(configs)) { - module.exports = [ - merge(configs[0], { - plugins: [new CopyWebpackPlugin(['demo/**/*.txt'])], - }), - configs[1], - ]; -} else { - module.exports = configs; -} diff --git a/packages/building-webpack/demo/js/webpack.modern.config.js b/packages/building-webpack/demo/js/webpack.modern.config.js deleted file mode 100644 index 0dd3ccda..00000000 --- a/packages/building-webpack/demo/js/webpack.modern.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const path = require('path'); -const merge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const createDefaultConfig = require('../../modern-config'); - -const defaultConfig = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -module.exports = merge(defaultConfig, { - plugins: [new CopyWebpackPlugin(['demo/**/*.txt'])], -}); diff --git a/packages/building-webpack/demo/ts-babel/.babelrc b/packages/building-webpack/demo/ts-babel/.babelrc deleted file mode 100644 index 69e89ec9..00000000 --- a/packages/building-webpack/demo/ts-babel/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugins": [ - ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], - "@babel/plugin-proposal-class-properties" - ], - "presets": ["@babel/preset-typescript"] -} diff --git a/packages/building-webpack/demo/ts-babel/a/b/import-meta-test-2.ts b/packages/building-webpack/demo/ts-babel/a/b/import-meta-test-2.ts deleted file mode 100644 index 4ce5b0dc..00000000 --- a/packages/building-webpack/demo/ts-babel/a/b/import-meta-test-2.ts +++ /dev/null @@ -1,4 +0,0 @@ -console.log(import.meta.url); -window.__importMeta2 = - import.meta.url.startsWith(window.location.origin) && - import.meta.url.endsWith('/a/b/import-meta-test-2.ts'); diff --git a/packages/building-webpack/demo/ts-babel/demo-app.ts b/packages/building-webpack/demo/ts-babel/demo-app.ts deleted file mode 100644 index e3b23264..00000000 --- a/packages/building-webpack/demo/ts-babel/demo-app.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { LitElement, html, css, customElement } from 'lit-element'; -import './demo-component.ts'; - -// partial css trips up the minifier -const fontSize = css` - 16 -`; - -const fontMd = css` - font-size: ${fontSize}px; -`; - -@customElement('demo-app') -class DemoApp extends LitElement { - static styles = css` - :host { - display: block; - color: black; - background-color: white; - ${fontMd} - } - `; - - render() { - return html` -

Demo app

- - - `; - } -} - -const cssText = DemoApp.styles.cssText.replace(/\s/g, ''); -const foo = { bar: 'lorem ipsum' }; -const loremIpsum = undefined; - -window.__optionalChaining = foo?.bar === 'lorem ipsum' && foo?.bar?.loremIpsum === undefined; -window.__nullishCoalescing = (loremIpsum ?? 'lorem ipsum') === 'lorem ipsum'; -window.__partialCSS = cssText.includes('font-size:16px') && cssText.includes('display:block'); -window.__litElement = (async () => { - await import('./lazy-component.ts'); - const app = document.body.querySelector('demo-app'); - const demoComponent = app.shadowRoot.querySelector('demo-component'); - const lazyComponent = app.shadowRoot.querySelector('lazy-component'); - - return ( - app.shadowRoot.innerHTML.includes('

Demo app

') && - demoComponent.shadowRoot.innerHTML.includes('

Demo component

') && - lazyComponent.shadowRoot.innerHTML.includes('

Lazy component

') - ); -})(); diff --git a/packages/building-webpack/demo/ts-babel/demo-component.ts b/packages/building-webpack/demo/ts-babel/demo-component.ts deleted file mode 100644 index 560ec7a4..00000000 --- a/packages/building-webpack/demo/ts-babel/demo-component.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable class-methods-use-this, import/no-extraneous-dependencies */ -import { LitElement, html, css, customElement } from 'lit-element'; - -@customElement('demo-component') -class DemoComponent extends LitElement { - static styles = css` - p { - color: blue; - } - `; - - render() { - return html` -

Demo component

- `; - } -} diff --git a/packages/building-webpack/demo/ts-babel/index.html b/packages/building-webpack/demo/ts-babel/index.html deleted file mode 100644 index b42e7156..00000000 --- a/packages/building-webpack/demo/ts-babel/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - My Demo - - - - -

Static content in index.html is preserved

- - - -
- - - - - \ No newline at end of file diff --git a/packages/building-webpack/demo/ts-babel/index.ts b/packages/building-webpack/demo/ts-babel/index.ts deleted file mode 100644 index 2c7d0823..00000000 --- a/packages/building-webpack/demo/ts-babel/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import './demo-app.ts'; -import './syntax.ts'; - -(async () => { - window.__tests = { - partialCSS: window.__partialCSS || false, - litElement: (await window.__litElement) || false, - startsWith: window.__startsWith || false, - map: window.__map || false, - importMeta: window.__importMeta || false, - importMeta2: window.__importMeta2 || false, - asyncFunction: (await window.__asyncFunction) || false, - forOf: window.__forOf || false, - optionalChaining: window.__optionalChaining || false, - nullishCoalescing: window.__nullishCoalescing || false, - }; - document.getElementById('test').innerHTML = `
${JSON.stringify(
-    window.__tests,
-    null,
-    2,
-  )}
`; -})(); diff --git a/packages/building-webpack/demo/ts-babel/lazy-component.ts b/packages/building-webpack/demo/ts-babel/lazy-component.ts deleted file mode 100644 index 3fb3478a..00000000 --- a/packages/building-webpack/demo/ts-babel/lazy-component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { LitElement, html, css, customElement } from 'lit-element'; - -@customElement('lazy-component') -class LazyComponent extends LitElement { - static styles = css` - p { - color: red; - } - `; - - render() { - return html` -

Lazy component

- `; - } -} diff --git a/packages/building-webpack/demo/ts-babel/syntax.ts b/packages/building-webpack/demo/ts-babel/syntax.ts deleted file mode 100644 index 55183162..00000000 --- a/packages/building-webpack/demo/ts-babel/syntax.ts +++ /dev/null @@ -1,27 +0,0 @@ -import './a/b/import-meta-test-2.ts'; - -async function asyncFunction(): Promise { - await new Promise(resolve => setTimeout(resolve, 1)); - return true; -} - -function forOf() { - const map = new Map(); - map.set('a', 1); - map.set('2', 2); - let total = 0; - for (const [k, v] of map) { - total += v; - } - return total; -} - -console.log('async function compiled to: ', asyncFunction.toString()); -console.log('forOf function compiled to: ', forOf.toString()); - -window.__startsWith = 'foo'.startsWith('fo'); -window.__map = new Map().set('foo', 'bar').get('foo') === 'bar'; -window.__importMeta = - import.meta.url.startsWith(window.location.origin) && import.meta.url.endsWith('syntax.ts'); -window.__asyncFunction = asyncFunction(); -window.__forOf = forOf() === 3; diff --git a/packages/building-webpack/demo/ts-babel/webpack.config.js b/packages/building-webpack/demo/ts-babel/webpack.config.js deleted file mode 100644 index 45f8d118..00000000 --- a/packages/building-webpack/demo/ts-babel/webpack.config.js +++ /dev/null @@ -1,19 +0,0 @@ -const path = require('path'); -const merge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const createDefaultConfigs = require('../../modern-and-legacy-config'); - -const configs = createDefaultConfigs({ - input: path.resolve(__dirname, './index.html'), -}); - -if (Array.isArray(configs)) { - module.exports = [ - merge(configs[0], { - plugins: [new CopyWebpackPlugin(['demo/**/*.txt'])], - }), - configs[1], - ]; -} else { - module.exports = configs; -} diff --git a/packages/building-webpack/demo/ts-babel/webpack.modern.config.js b/packages/building-webpack/demo/ts-babel/webpack.modern.config.js deleted file mode 100644 index 0dd3ccda..00000000 --- a/packages/building-webpack/demo/ts-babel/webpack.modern.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const path = require('path'); -const merge = require('webpack-merge'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const createDefaultConfig = require('../../modern-config'); - -const defaultConfig = createDefaultConfig({ - input: path.resolve(__dirname, './index.html'), -}); - -module.exports = merge(defaultConfig, { - plugins: [new CopyWebpackPlugin(['demo/**/*.txt'])], -}); diff --git a/packages/building-webpack/index.js b/packages/building-webpack/index.js deleted file mode 100644 index 75d4073c..00000000 --- a/packages/building-webpack/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const createDefaultConfig = require('./modern-config.js'); -const createCompatibilityConfig = require('./modern-and-legacy-config.js'); - -module.exports = { createDefaultConfig, createCompatibilityConfig }; diff --git a/packages/building-webpack/modern-and-legacy-config.js b/packages/building-webpack/modern-and-legacy-config.js deleted file mode 100644 index 64600591..00000000 --- a/packages/building-webpack/modern-and-legacy-config.js +++ /dev/null @@ -1,191 +0,0 @@ -const { findSupportedBrowsers } = require('@open-wc/building-utils'); -const customMinifyCSS = require('@open-wc/building-utils/custom-minify-css'); -const { GenerateSW } = require('workbox-webpack-plugin'); -const path = require('path'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); -const merge = require('webpack-merge'); -const getDefaultMode = require('./src/get-default-mode'); - -const defaultOptions = { - // default mode is set based on --mode parameter, or default - // production. this can be overwritten manually in the config - mode: getDefaultMode(), - input: './index.html', - plugins: { - indexHTML: true, - workbox: true, - }, -}; - -/* eslint-disable-next-line no-shadow */ -function createConfig(options, legacy) { - if (options.entry) { - /* eslint-disable-next-line no-console */ - console.warn( - '[@open-wc/building-webpack]: options.entry is deprecated. Use options.input instead.', - ); - } - - const firstConfig = legacy; - const production = options.mode === 'production'; - const inputPrefix = legacy ? 'legacy/' : ''; - - const outputFilename = `${inputPrefix}${ - production ? '[contenthash].js' : '[name].development.js' - }`; - const outputChunkFilename = `${inputPrefix}${ - production ? '[contenthash].js' : 'chunk-[id].development.js' - }`; - - return { - entry: options.input || options.entry, - - output: { - filename: outputFilename, - chunkFilename: outputChunkFilename, - path: path.resolve(process.cwd(), `dist`), - }, - - mode: options.mode, - - devtool: 'cheap-module-source-map', - - // don't polyfill any node built-in libraries - node: false, - - resolve: { - mainFields: [ - // current leading de-facto standard - see https://github.com/rollup/rollup/wiki/pkg.module - 'module', - // previous de-facto standard, superceded by `module`, but still in use by some packages - 'jsnext:main', - // standard package.json fields - 'browser', - 'main', - ], - modules: ['node_modules', 'web_modules'], - }, - - module: { - rules: [ - { - test: /\.js$|\.ts$/, - use: { - loader: 'babel-loader', - - options: { - plugins: [ - require.resolve('@babel/plugin-syntax-dynamic-import'), - require.resolve('@babel/plugin-syntax-import-meta'), - production && [ - require.resolve('babel-plugin-template-html-minifier'), - { - modules: { - 'lit-html': ['html'], - 'lit-element': ['html', { name: 'css', encapsulation: 'style' }], - }, - htmlMinifier: { - collapseWhitespace: true, - conservativeCollapse: true, - removeComments: true, - caseSensitive: true, - minifyCSS: customMinifyCSS, - }, - }, - ], - // webpack does not support import.meta.url yet, so we rewrite them in babel - [require.resolve('babel-plugin-bundled-import-meta'), { importStyle: 'baseURI' }], - ].filter(_ => !!_), - - presets: [ - [ - require.resolve('@babel/preset-env'), - { - targets: legacy ? ['ie 11'] : findSupportedBrowsers(), - // preset-env compiles template literals for safari 12 due to a small bug which - // doesn't affect most use cases. for example lit-html handles it: (https://github.com/Polymer/lit-html/issues/575) - exclude: legacy ? undefined : ['@babel/plugin-transform-template-literals'], - useBuiltIns: false, - modules: false, - bugfixes: true, - }, - ], - ], - }, - }, - }, - ].filter(_ => !!_), - }, - - optimization: { - minimizer: [ - production && - new TerserPlugin({ - terserOptions: { - output: { - comments: false, - }, - }, - parallel: true, - sourceMap: true, - }), - ].filter(_ => !!_), - }, - - plugins: [ - // @ts-ignore - firstConfig && new CleanWebpackPlugin(), - - options.plugins.indexHTML && - new WebpackIndexHTMLPlugin( - merge( - { - multiBuild: true, - legacy, - polyfills: { - coreJs: true, - regeneratorRuntime: true, - webcomponents: true, - fetch: true, - }, - }, - options.webpackIndexHTMLPlugin, - ), - ), - production && - options.plugins.workbox && - new GenerateSW({ - exclude: [/legacy\/.*.js/], - // for spa client side routing, always return index.html - navigateFallback: '/index.html', - // where to output the generated sw - swDest: 'sw.js', - }), - ].filter(_ => !!_), - - devServer: { - contentBase: process.cwd(), - compress: true, - port: 8080, - historyApiFallback: false, - stats: { - stats: 'errors-only', - }, - }, - }; -} - -module.exports = userOptions => { - const options = { - ...defaultOptions, - ...userOptions, - plugins: { - ...defaultOptions.plugins, - ...(userOptions.plugins || {}), - }, - }; - - return [createConfig(options, true), createConfig(options, false)]; -}; diff --git a/packages/building-webpack/modern-config.js b/packages/building-webpack/modern-config.js deleted file mode 100644 index cf825c68..00000000 --- a/packages/building-webpack/modern-config.js +++ /dev/null @@ -1,163 +0,0 @@ -const { findSupportedBrowsers } = require('@open-wc/building-utils'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); -const customMinifyCSS = require('@open-wc/building-utils/custom-minify-css'); -const { GenerateSW } = require('workbox-webpack-plugin'); -const path = require('path'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); -const getDefaultMode = require('./src/get-default-mode'); - -const defaultOptions = { - // default mode is set based on --mode parameter, or default - // production. this can be overwritten manually in the config - mode: getDefaultMode(), - input: './index.html', - plugins: { - indexHTML: true, - workbox: true, - }, -}; - -module.exports = userOptions => { - const options = { - ...defaultOptions, - ...userOptions, - plugins: { - ...defaultOptions.plugins, - ...(userOptions.plugins || {}), - }, - }; - - const production = options.mode === 'production'; - - if (options.entry) { - /* eslint-disable-next-line no-console */ - console.warn( - '[@open-wc/building-webpack]: options.entry is deprecated. Use options.input instead.', - ); - } - - const outputFilename = production ? '[contenthash].js' : '[name].development.js'; - const outputChunkFilename = production ? '[contenthash].js' : 'chunk-[id].development.js'; - - return { - entry: options.input || options.entry, - - output: { - filename: outputFilename, - chunkFilename: outputChunkFilename, - path: path.resolve(process.cwd(), 'dist'), - }, - - mode: options.mode, - - devtool: 'cheap-module-source-map', - - // don't polyfill any node built-in libraries - node: false, - - resolve: { - mainFields: [ - // current leading de-facto standard - see https://github.com/rollup/rollup/wiki/pkg.module - 'module', - // previous de-facto standard, superceded by `module`, but still in use by some packages - 'jsnext:main', - // standard package.json fields - 'browser', - 'main', - ], - modules: ['node_modules', 'web_modules'], - }, - - module: { - rules: [ - { - test: /\.js$|.ts$/, - use: { - loader: 'babel-loader', - options: { - plugins: [ - require.resolve('@babel/plugin-syntax-dynamic-import'), - require.resolve('@babel/plugin-syntax-import-meta'), - production && [ - require.resolve('babel-plugin-template-html-minifier'), - { - modules: { - 'lit-html': ['html'], - 'lit-element': ['html', { name: 'css', encapsulation: 'style' }], - }, - htmlMinifier: { - collapseWhitespace: true, - conservativeCollapse: true, - removeComments: true, - caseSensitive: true, - minifyCSS: customMinifyCSS, - }, - }, - ], - // webpack does not support import.meta.url yet, so we rewrite them in babel - [require.resolve('babel-plugin-bundled-import-meta'), { importStyle: 'baseURI' }], - ].filter(_ => !!_), - - presets: [ - [ - require.resolve('@babel/preset-env'), - { - targets: findSupportedBrowsers(), - // preset-env compiles template literals for safari 12 due to a small bug which - // doesn't affect most use cases. for example lit-html handles it: (https://github.com/Polymer/lit-html/issues/575) - exclude: ['@babel/plugin-transform-template-literals'], - useBuiltIns: false, - modules: false, - bugfixes: true, - }, - ], - ], - }, - }, - }, - ].filter(_ => !!_), - }, - - optimization: { - minimizer: [ - production && - new TerserPlugin({ - terserOptions: { - output: { - comments: false, - }, - }, - parallel: true, - sourceMap: true, - }), - ].filter(_ => !!_), - }, - - plugins: [ - // @ts-ignore - new CleanWebpackPlugin(), - - new WebpackIndexHTMLPlugin(options.webpackIndexHTMLPlugin), - production && - options.plugins.workbox && - new GenerateSW({ - exclude: [/legacy\/.*.js/], - // for spa client side routing, always return index.html - navigateFallback: '/index.html', - // where to output the generated sw - swDest: 'sw.js', - }), - ].filter(_ => !!_), - - devServer: { - contentBase: process.cwd(), - compress: true, - port: 8080, - historyApiFallback: true, - stats: { - stats: 'errors-only', - }, - }, - }; -}; diff --git a/packages/building-webpack/package.json b/packages/building-webpack/package.json deleted file mode 100644 index 776cd142..00000000 --- a/packages/building-webpack/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@open-wc/building-webpack", - "version": "2.13.46", - "publishConfig": { - "access": "public" - }, - "description": "Default configuration for working with webpack", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/open-wc/open-wc.git", - "directory": "packages/building-webpack" - }, - "author": "open-wc", - "homepage": "https://github.com/open-wc/open-wc/tree/master/packages/building-webpack", - "main": "index.js", - "scripts": { - "demo:build": "webpack --mode production --config demo/js/webpack.config.js", - "demo:build:dev": "webpack --mode development --config demo/js/webpack.config.js", - "demo:build:modern": "webpack --mode=production --config demo/js/webpack.modern.config.js", - "demo:build:stats": "webpack --mode=production --config demo/js/webpack.modern.config.js --profile --json > build-stats.json", - "demo:build:ts": "webpack --mode=production --config demo/ts/webpack.config.js", - "demo:build:ts-babel": "webpack --mode=production --config demo/ts-babel/webpack.config.js", - "demo:start": "es-dev-server --root-dir dist --open", - "demo:webpack-dev": "webpack-dev-server --mode=development --config demo/js/webpack.config.js --open", - "demo:webpack-dev:legacy": "webpack-dev-server --mode=development --config demo/js/webpack.config.js --open --legacy", - "demo:webpack-dev:modern": "webpack-dev-server --mode=development --config demo/js/webpack.modern.config.js --open", - "prepublishOnly": "../../scripts/insert-header.js", - "test": "npm run test:node", - "test:node": "mocha test/**/*.test.js test/*.test.js" - }, - "files": [ - "*.js", - "dom5-fork", - "src" - ], - "keywords": [ - "open-wc", - "webpack", - "config" - ], - "dependencies": { - "@babel/core": "^7.11.1", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", - "@babel/plugin-proposal-optional-chaining": "^7.11.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/preset-env": "^7.9.0", - "@open-wc/building-utils": "^2.18.3", - "@open-wc/webpack-index-html-plugin": "^1.7.14", - "babel-loader": "^8.0.0", - "babel-plugin-bundled-import-meta": "^0.3.2", - "babel-plugin-template-html-minifier": "^4.0.0", - "clean-webpack-plugin": "^2.0.0", - "copy-webpack-plugin": "^5.0.1", - "es-dev-server": "^1.57.8", - "terser-webpack-plugin": "^2.3.0", - "webpack-merge": "^4.1.5", - "workbox-webpack-plugin": "^4.3.1" - }, - "devDependencies": { - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/preset-typescript": "^7.8.3", - "@babel/register": "^7.9.0", - "http-server": "^0.11.1", - "ts-loader": "^5.3.3", - "webpack": "^4.28.0", - "webpack-bundle-analyzer": "^3.0.3", - "webpack-cli": "^3.3.9", - "webpack-dev-server": "^3.7.1" - } -} diff --git a/packages/building-webpack/src/get-default-mode.js b/packages/building-webpack/src/get-default-mode.js deleted file mode 100644 index 385e4d95..00000000 --- a/packages/building-webpack/src/get-default-mode.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = function getDefaultMode() { - // webpack standard is to use --mode=production - const modeArg = process.argv.find(arg => arg.startsWith('--mode=')); - if (modeArg) { - return modeArg.replace('--mode=', ''); - } - - // our old convention was --mode production, so we remain backwards compatible with that - const indexOf = process.argv.indexOf('--mode'); - return indexOf === -1 ? 'production' : process.argv[indexOf + 1]; -}; diff --git a/packages/building-webpack/test/integration.test.js b/packages/building-webpack/test/integration.test.js deleted file mode 100644 index 877fdb86..00000000 --- a/packages/building-webpack/test/integration.test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* eslint-disable global-require, import/no-dynamic-require */ -const puppeteer = require('puppeteer'); -const { expect } = require('chai'); -const path = require('path'); -const fs = require('fs'); -const webpack = require('webpack'); -const rimraf = require('rimraf'); -const { startServer, createConfig } = require('es-dev-server'); - -const rootDir = path.resolve(__dirname, '..', 'dist'); -const testCases = ['js', 'ts-babel']; - -function compileAsync(config) { - return new Promise((resolve, reject) => { - const compiler = webpack(config); - - const cb = (err, stats) => { - if (err) { - reject(err); - } else { - resolve(stats); - } - }; - - compiler.run(cb); - }); -} - -describe('integration tests', () => { - let server; - let serverConfig; - /** @type {import('puppeteer').Browser} */ - let browser; - - before(async () => { - serverConfig = createConfig({ - port: 8082, - rootDir, - }); - - ({ server } = await startServer(serverConfig)); - browser = await puppeteer.launch(); - rimraf.sync(rootDir); - }); - - after(async () => { - await browser.close(); - await new Promise(resolve => - server.close(() => { - resolve(); - }), - ); - }); - - testCases.forEach(testCase => { - ['modern', 'modern-and-legacy'].forEach(mode => { - describe(`testcase ${testCase}-${mode}`, function describe() { - this.timeout(10000); - let page; - - before(async () => { - const configName = mode === 'modern' ? 'webpack.modern.config.js' : 'webpack.config.js'; - const configPath = path.join(__dirname, '..', 'demo', testCase, configName); - const config = require(configPath); - - if (Array.isArray(config)) { - await compileAsync(config[0]); - await compileAsync(config[1]); - } else { - await compileAsync(config); - } - - page = await browser.newPage(); - await page.goto('http://localhost:8082/', { - waitUntil: 'networkidle0', - }); - }); - - after(() => { - rimraf.sync(rootDir); - }); - - it('passes the in-browser tests', async () => { - // @ts-ignore - const browserTests = await page.evaluate(() => window.__tests); - expect(browserTests).to.eql({ - partialCSS: true, - litElement: true, - startsWith: true, - map: true, - importMeta: true, - importMeta2: true, - asyncFunction: true, - forOf: true, - optionalChaining: true, - nullishCoalescing: true, - }); - }); - - it('outputs a service worker', () => { - expect(fs.existsSync(path.join(rootDir, 'sw.js'))).to.be.true; - }); - }); - }); - }); -}); diff --git a/packages/webpack-import-meta-loader/.babelrc b/packages/webpack-import-meta-loader/.babelrc deleted file mode 100644 index 23c42dd7..00000000 --- a/packages/webpack-import-meta-loader/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [[ - "env", - { - "targets": { - "node": "10" - } - } - ]] -} diff --git a/packages/webpack-import-meta-loader/CHANGELOG.md b/packages/webpack-import-meta-loader/CHANGELOG.md deleted file mode 100644 index 36b4c5e3..00000000 --- a/packages/webpack-import-meta-loader/CHANGELOG.md +++ /dev/null @@ -1,226 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [0.4.7](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.6...@open-wc/webpack-import-meta-loader@0.4.7) (2020-05-25) - - -### Bug Fixes - -* **webpack-import-meta-loader:** fix a bug in the publicPath logic ([#1677](https://github.com/open-wc/open-wc/issues/1677)) ([f8ff5e8](https://github.com/open-wc/open-wc/commit/f8ff5e8a6bfea75112d2de74e77ebc9a96623a7c)) - - - - - -## [0.4.6](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.5...@open-wc/webpack-import-meta-loader@0.4.6) (2020-04-20) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.4.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.4...@open-wc/webpack-import-meta-loader@0.4.5) (2020-04-12) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.4.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.3...@open-wc/webpack-import-meta-loader@0.4.4) (2020-03-24) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.4.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.2...@open-wc/webpack-import-meta-loader@0.4.3) (2020-02-09) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.4.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.1...@open-wc/webpack-import-meta-loader@0.4.2) (2020-02-02) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.4.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.4.0...@open-wc/webpack-import-meta-loader@0.4.1) (2019-11-24) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -# [0.4.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.3.4...@open-wc/webpack-import-meta-loader@0.4.0) (2019-11-19) - - -### Features - -* update to use auto compatibility of es-dev-server ([f6d085e](https://github.com/open-wc/open-wc/commit/f6d085eda5a05391d1a464b9e49222c78194b0d9)) - - - - - -## [0.3.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.3.3...@open-wc/webpack-import-meta-loader@0.3.4) (2019-10-25) - - -### Bug Fixes - -* align used mocha version ([#901](https://github.com/open-wc/open-wc/issues/901)) ([3606381](https://github.com/open-wc/open-wc/commit/3606381)) - - - - - -## [0.3.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.3.2...@open-wc/webpack-import-meta-loader@0.3.3) (2019-10-23) - - -### Bug Fixes - -* add package keywords ([#859](https://github.com/open-wc/open-wc/issues/859)) ([cd78405](https://github.com/open-wc/open-wc/commit/cd78405)) - - - - - -## [0.3.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.3.1...@open-wc/webpack-import-meta-loader@0.3.2) (2019-10-16) - - -### Bug Fixes - -* **webpack-import-meta-loader:** transform template literals to js ([#872](https://github.com/open-wc/open-wc/issues/872)) ([2efd727](https://github.com/open-wc/open-wc/commit/2efd727)) - - - - - -## [0.3.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.3.0...@open-wc/webpack-import-meta-loader@0.3.1) (2019-08-05) - - -### Bug Fixes - -* cleanup package.json scripts ([be6bdb5](https://github.com/open-wc/open-wc/commit/be6bdb5)) - - - - - -# [0.3.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.5...@open-wc/webpack-import-meta-loader@0.3.0) (2019-07-14) - - -### Features - -* **webpack-import-meta-loader:** support for __webpack_public_path__ ([#570](https://github.com/open-wc/open-wc/issues/570)) ([f072185](https://github.com/open-wc/open-wc/commit/f072185)) - - - - - -## [0.2.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.4...@open-wc/webpack-import-meta-loader@0.2.5) (2019-07-08) - - -### Bug Fixes - -* use file extensions for imports to support import maps ([c711b13](https://github.com/open-wc/open-wc/commit/c711b13)) - - - - - -## [0.2.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.3...@open-wc/webpack-import-meta-loader@0.2.4) (2019-06-05) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.2.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.2...@open-wc/webpack-import-meta-loader@0.2.3) (2019-06-04) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.2.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.1...@open-wc/webpack-import-meta-loader@0.2.2) (2019-06-03) - - -### Bug Fixes - -* **webpack-import-meta-loader:** rewrite all backslashes ([#477](https://github.com/open-wc/open-wc/issues/477)) ([ade8a65](https://github.com/open-wc/open-wc/commit/ade8a65)) - - - - - -## [0.2.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.2.0...@open-wc/webpack-import-meta-loader@0.2.1) (2019-05-03) - - -### Bug Fixes - -* **webpack-import-meta-loader:** fix filepaths ([4480d2d](https://github.com/open-wc/open-wc/commit/4480d2d)) - - - - - -# [0.2.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.1.3...@open-wc/webpack-import-meta-loader@0.2.0) (2019-03-23) - - -### Features - -* add types + linting & improve intellisense ([b6d260c](https://github.com/open-wc/open-wc/commit/b6d260c)) - - - - - -## [0.1.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.1.2...@open-wc/webpack-import-meta-loader@0.1.3) (2019-03-08) - -**Note:** Version bump only for package @open-wc/webpack-import-meta-loader - - - - - -## [0.1.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-import-meta-loader@0.1.1...@open-wc/webpack-import-meta-loader@0.1.2) (2019-02-16) - - -### Bug Fixes - -* update package repository fields with monorepo details ([cb1acb7](https://github.com/open-wc/open-wc/commit/cb1acb7)) - - - - - -## [0.1.1](https://github.com/open-wc/open-wc/tree/master/packages/webpack-import-meta-loader/compare/@open-wc/webpack-import-meta-loader@0.1.0...@open-wc/webpack-import-meta-loader@0.1.1) (2019-02-02) - - -### Bug Fixes - -* unify npm readme header for all open-wc packages ([1bac939](https://github.com/open-wc/open-wc/tree/master/packages/webpack-import-meta-loader/commit/1bac939)) - - - - - -# 0.1.0 (2019-01-26) - - -### Features - -* add webpack-import-meta-loader ([38dad6a](https://github.com/open-wc/open-wc/tree/master/packages/webpack-import-meta-loader/commit/38dad6a)) diff --git a/packages/webpack-import-meta-loader/LICENSE b/packages/webpack-import-meta-loader/LICENSE deleted file mode 100644 index 60227747..00000000 --- a/packages/webpack-import-meta-loader/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 open-wc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/webpack-import-meta-loader/README.md b/packages/webpack-import-meta-loader/README.md index bdf7ac1a..9f36064f 100644 --- a/packages/webpack-import-meta-loader/README.md +++ b/packages/webpack-import-meta-loader/README.md @@ -1,33 +1 @@ -# Webpack Helpers - -Webpack loader for supporting `import.meta` in webpack. - -[//]: # 'AUTO INSERT HEADER PREPUBLISH' - -## Note - -This is NOT an optimal solution e.g. it may slow down your build a little. -However as currently `import.meta` results in an webpack parse error using a loader is probably the only thing we can do for now. -For details see - -- [https://github.com/webpack/webpack/issues/6719](https://github.com/webpack/webpack/issues/6719) -- [https://github.com/Polymer/tools/issues/518](https://github.com/Polymer/tools/issues/518) - -If webpack fixed that parse error import.meta will probably work out of the box. -If not then a babel plugin (that can work with AST) will be a better solution. - -## Manual Setup - -- `yarn add @open-wc/webpack-import-meta-loader` -- Add this to your webpack config - -```js -module: { - rules: [ - { - test: /\.js$/, - loader: require.resolve('@open-wc/webpack-import-meta-loader'), - }, - ], -}, -``` +I move into the legacy repository [webpack-import-meta-loader](https://github.com/open-wc/legacy/tree/master/packages/webpack-import-meta-loader) we now recommend [babel-plugin-bundled-import-meta](https://www.npmjs.com/package/babel-plugin-bundled-import-meta). diff --git a/packages/webpack-import-meta-loader/package.json b/packages/webpack-import-meta-loader/package.json deleted file mode 100644 index d279c8ce..00000000 --- a/packages/webpack-import-meta-loader/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@open-wc/webpack-import-meta-loader", - "version": "0.4.7", - "publishConfig": { - "access": "public" - }, - "description": "Webpack configuration following open-wc recommendations", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/open-wc/open-wc.git", - "directory": "packages/webpack-import-meta-loader" - }, - "author": "open-wc", - "homepage": "https://github.com/open-wc/open-wc/tree/master/packages/webpack-import-meta-loader", - "main": "webpack-import-meta-loader.js", - "scripts": { - "prepublishOnly": "../../scripts/insert-header.js", - "test": "npm run test:node", - "test:node": "mocha --require @babel/register" - }, - "files": [ - "*.js", - "src" - ], - "keywords": [ - "webpack", - "meta-loader", - "import-meta" - ], - "devDependencies": { - "@babel/register": "^7.9.0", - "babel-preset-env": "^1.7.0", - "memory-fs": "^0.4.1", - "webpack": "^4.28.0" - } -} diff --git a/packages/webpack-import-meta-loader/src/to-browser-path.js b/packages/webpack-import-meta-loader/src/to-browser-path.js deleted file mode 100644 index e41059fe..00000000 --- a/packages/webpack-import-meta-loader/src/to-browser-path.js +++ /dev/null @@ -1,5 +0,0 @@ -const path = require('path'); - -module.exports = function toBrowserPath(filePath, _path = path) { - return filePath.replace(new RegExp(_path.sep === '\\' ? '\\\\' : _path.sep, 'g'), '/'); -}; diff --git a/packages/webpack-import-meta-loader/test/caseA/index.js b/packages/webpack-import-meta-loader/test/caseA/index.js deleted file mode 100644 index 63f085fd..00000000 --- a/packages/webpack-import-meta-loader/test/caseA/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export const foo = new URL('./', import.meta.url); -export const bar = new URL('./', import.meta.url); diff --git a/packages/webpack-import-meta-loader/test/caseA/return.js b/packages/webpack-import-meta-loader/test/caseA/return.js deleted file mode 100644 index 91c11d0a..00000000 --- a/packages/webpack-import-meta-loader/test/caseA/return.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = () => import.meta; diff --git a/packages/webpack-import-meta-loader/test/caseB/caseBsub/caseBsub.js b/packages/webpack-import-meta-loader/test/caseB/caseBsub/caseBsub.js deleted file mode 100644 index adbf9b15..00000000 --- a/packages/webpack-import-meta-loader/test/caseB/caseBsub/caseBsub.js +++ /dev/null @@ -1 +0,0 @@ -export const bar = new URL('./', import.meta.url); diff --git a/packages/webpack-import-meta-loader/test/caseB/index.js b/packages/webpack-import-meta-loader/test/caseB/index.js deleted file mode 100644 index 6b772d6a..00000000 --- a/packages/webpack-import-meta-loader/test/caseB/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import './caseBsub/caseBsub.js'; - -export const foo = new URL('./', import.meta.url); diff --git a/packages/webpack-import-meta-loader/test/compiler.js b/packages/webpack-import-meta-loader/test/compiler.js deleted file mode 100644 index b856a241..00000000 --- a/packages/webpack-import-meta-loader/test/compiler.js +++ /dev/null @@ -1,28 +0,0 @@ -import path from 'path'; -import webpack from 'webpack'; -import MemoryFs from 'memory-fs'; - -export default (fixture, rules = [{}]) => { - const compiler = webpack({ - mode: 'development', - context: __dirname, - entry: `./${fixture}`, - output: { - path: path.resolve(__dirname), - filename: 'bundle.js', - }, - module: { - rules, - }, - }); - - compiler.outputFileSystem = new MemoryFs(); - - return new Promise((resolve, reject) => { - compiler.run((err, stats) => { - if (err || stats.hasErrors()) reject(err); - - resolve(stats); - }); - }); -}; diff --git a/packages/webpack-import-meta-loader/test/to-browser-path.test.js b/packages/webpack-import-meta-loader/test/to-browser-path.test.js deleted file mode 100644 index feae8f49..00000000 --- a/packages/webpack-import-meta-loader/test/to-browser-path.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const { expect } = require('chai'); -const toBrowserPath = require('../src/to-browser-path'); - -describe('toBrowserPath', () => { - it('replaces all path windows separators', () => { - // @ts-ignore - expect(toBrowserPath('foo\\bar\\buz', { sep: '\\' })).to.equal('foo/bar/buz'); - }); - - it('preserves all unix path separators', () => { - // @ts-ignore - expect(toBrowserPath('foo/bar/buz', { sep: '/' })).to.equal('foo/bar/buz'); - }); -}); diff --git a/packages/webpack-import-meta-loader/test/webpack-import-meta-loader.test.js b/packages/webpack-import-meta-loader/test/webpack-import-meta-loader.test.js deleted file mode 100644 index ba190249..00000000 --- a/packages/webpack-import-meta-loader/test/webpack-import-meta-loader.test.js +++ /dev/null @@ -1,50 +0,0 @@ -/* eslint-disable no-template-curly-in-string */ - -import chai from 'chai'; -import path from 'path'; -import { EOL as newLine } from 'os'; -import compiler from './compiler.js'; - -const { expect } = chai; - -const rules = [ - { - test: /\.js$/, - loader: path.resolve(__dirname, '../webpack-import-meta-loader.js'), - }, -]; -function getOnlyDynamicSource(source) { - return source.split('\n').splice(18).join(newLine); -} - -describe('import-meta-url-loader', () => { - it('Replaces all instances of import.meta', async () => { - const stats = await compiler('caseA/index.js', rules); - const caseA = getOnlyDynamicSource(stats.toJson().modules[0].source); - - expect(caseA).to.equal( - `${"export const foo = new URL('./', ({ url: getAbsoluteUrl('caseA/index.js') }).url);"}${newLine}export const bar = new URL('./', ({ url: getAbsoluteUrl('caseA/index.js') }).url);${newLine}`, - ); - - const statsReturn = await compiler('caseA/return.js', rules); - const caseAreturn = getOnlyDynamicSource(statsReturn.toJson().modules[0].source); - // eslint-disable-next-line quotes - expect(caseAreturn).to.equal( - `export const foo = () => ({ url: getAbsoluteUrl('caseA/return.js') });${newLine}`, - ); - }); - - it('Replaces nested instances of import.meta', async () => { - const stats = await compiler('caseB/index.js', rules); - const caseB = getOnlyDynamicSource(stats.toJson().modules[1].source); - const caseBsub = getOnlyDynamicSource(stats.toJson().modules[0].source); - - expect(caseB).to.equal( - `${"import './caseBsub/caseBsub.js';"}${newLine}${newLine}export const foo = new URL('./', ({ url: getAbsoluteUrl('caseB/index.js') }).url);${newLine}`, - ); - - expect(caseBsub).to.equal( - `export const bar = new URL('./', ({ url: getAbsoluteUrl('caseB/caseBsub/caseBsub.js') }).url);${newLine}`, - ); - }); -}); diff --git a/packages/webpack-import-meta-loader/webpack-import-meta-loader.js b/packages/webpack-import-meta-loader/webpack-import-meta-loader.js deleted file mode 100644 index 3bf46954..00000000 --- a/packages/webpack-import-meta-loader/webpack-import-meta-loader.js +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck -const toBrowserPath = require('./src/to-browser-path'); -const regex = /import\.meta/g; - -/** - * Webpack loader to rewrite `import.meta` in modules with url data to the source code file location. - * - * @example - * return import.meta; - * // becomes: return ({ url: `${window.location.protocol}//${window.location.host}/relative/path/to/file.js` }); - * - * return import.meta.url; - * // becomes: return ({ url: `${window.location.protocol}//${window.location.host}/relative/path/to/file.js` }).url; - */ -module.exports = function (source) { - const path = require('path'); - - const relativePath = this.context.substring( - this.context.indexOf(this.rootContext) + this.rootContext.length + 1, - this.resource.lastIndexOf(path.sep) + 1, - ); - - const browserPath = toBrowserPath(relativePath); - - const fileName = this.resource.substring(this.resource.lastIndexOf(path.sep) + 1); - - let found = false; - let rewrittenSource = source.replace(regex, () => { - found = true; - return `({ url: getAbsoluteUrl('${browserPath}/${fileName}') })`; - }); - - if (found) { - return ` - function getAbsoluteUrl(relativeUrl) { - const publicPath = __webpack_public_path__; - - let url = ''; - - if (!publicPath || publicPath.indexOf('://') < 0) { - url += window.location.protocol + '//' + window.location.host; - } - - if (publicPath) { - url += publicPath; - } else { - url += '/'; - } - - return url + relativeUrl; - } -${rewrittenSource}`; - } else { - return source; - } -}; diff --git a/packages/webpack-index-html-plugin/CHANGELOG.md b/packages/webpack-index-html-plugin/CHANGELOG.md deleted file mode 100644 index 14dada64..00000000 --- a/packages/webpack-index-html-plugin/CHANGELOG.md +++ /dev/null @@ -1,544 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.7.14](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.13...@open-wc/webpack-index-html-plugin@1.7.14) (2020-10-11) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.13](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.12...@open-wc/webpack-index-html-plugin@1.7.13) (2020-10-01) - - -### Bug Fixes - -* change parameters order due to typescript error ([846d5c4](https://github.com/open-wc/open-wc/commit/846d5c4deb4e128568de055382f9563c59f02e76)) - - - - - -## [1.7.12](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.11...@open-wc/webpack-index-html-plugin@1.7.12) (2020-09-25) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.11](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.10...@open-wc/webpack-index-html-plugin@1.7.11) (2020-08-27) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.10](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.9...@open-wc/webpack-index-html-plugin@1.7.10) (2020-05-13) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.9](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.8...@open-wc/webpack-index-html-plugin@1.7.9) (2020-05-05) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.8](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.7...@open-wc/webpack-index-html-plugin@1.7.8) (2020-04-20) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.7](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.6...@open-wc/webpack-index-html-plugin@1.7.7) (2020-04-16) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.6](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.5...@open-wc/webpack-index-html-plugin@1.7.6) (2020-04-12) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.4...@open-wc/webpack-index-html-plugin@1.7.5) (2020-04-05) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.3...@open-wc/webpack-index-html-plugin@1.7.4) (2020-03-24) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.2...@open-wc/webpack-index-html-plugin@1.7.3) (2020-03-11) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.1...@open-wc/webpack-index-html-plugin@1.7.2) (2020-03-10) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.7.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.7.0...@open-wc/webpack-index-html-plugin@1.7.1) (2020-03-06) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# [1.7.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.5...@open-wc/webpack-index-html-plugin@1.7.0) (2020-02-29) - - -### Features - -* **rollup-plugin-html:** first release ([9acb29a](https://github.com/open-wc/open-wc/commit/9acb29ac84b0ef7e2b06c57043c9d2c76d5a29c0)) - - - - - -## [1.6.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.4...@open-wc/webpack-index-html-plugin@1.6.5) (2020-02-23) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.6.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.3...@open-wc/webpack-index-html-plugin@1.6.4) (2020-02-10) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.6.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.2...@open-wc/webpack-index-html-plugin@1.6.3) (2020-02-09) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.6.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.1...@open-wc/webpack-index-html-plugin@1.6.2) (2020-02-06) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.6.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.6.0...@open-wc/webpack-index-html-plugin@1.6.1) (2020-02-02) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# [1.6.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.10...@open-wc/webpack-index-html-plugin@1.6.0) (2020-01-31) - - -### Bug Fixes - -* skip brooken published versions ([25d21de](https://github.com/open-wc/open-wc/commit/25d21def522f22f98fc8c71b4c055617089c0e23)) - - -### Features - -* **polyfills-loader:** add polyfills loader ([249fee8](https://github.com/open-wc/open-wc/commit/249fee8a64982021eb2e1ad1937f3c08a4abc3c5)) - - - - - -## [1.5.10](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.9...@open-wc/webpack-index-html-plugin@1.5.10) (2019-12-09) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.5.9](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.8...@open-wc/webpack-index-html-plugin@1.5.9) (2019-12-05) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.5.8](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.7...@open-wc/webpack-index-html-plugin@1.5.8) (2019-12-01) - - -### Bug Fixes - -* **building-utils:** update snapshots ([5fc118a](https://github.com/open-wc/open-wc/commit/5fc118af6c19412cc7f782e73e6006234aa892d0)) - - - - - -## [1.5.7](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.6...@open-wc/webpack-index-html-plugin@1.5.7) (2019-11-24) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.5.6](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.5...@open-wc/webpack-index-html-plugin@1.5.6) (2019-11-20) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.5.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.4...@open-wc/webpack-index-html-plugin@1.5.5) (2019-11-19) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.5.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.3...@open-wc/webpack-index-html-plugin@1.5.4) (2019-11-03) - - -### Bug Fixes - -* align versions within the monorepo ([fa2ad9f](https://github.com/open-wc/open-wc/commit/fa2ad9f)) - - - - - -## [1.5.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.2...@open-wc/webpack-index-html-plugin@1.5.3) (2019-10-25) - - -### Bug Fixes - -* align used mocha version ([#901](https://github.com/open-wc/open-wc/issues/901)) ([3606381](https://github.com/open-wc/open-wc/commit/3606381)) - - - - - -## [1.5.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.1...@open-wc/webpack-index-html-plugin@1.5.2) (2019-10-23) - - -### Bug Fixes - -* add package keywords ([#859](https://github.com/open-wc/open-wc/issues/859)) ([cd78405](https://github.com/open-wc/open-wc/commit/cd78405)) - - - - - -## [1.5.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.5.0...@open-wc/webpack-index-html-plugin@1.5.1) (2019-10-22) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# [1.5.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.4.2...@open-wc/webpack-index-html-plugin@1.5.0) (2019-09-27) - - -### Features - -* **building-utils:** add option to polyfillsConfig to disable hashes in filenames ([#808](https://github.com/open-wc/open-wc/issues/808)) ([6763b83](https://github.com/open-wc/open-wc/commit/6763b83)) - - - - - -## [1.4.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.4.1...@open-wc/webpack-index-html-plugin@1.4.2) (2019-09-22) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.4.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.4.0...@open-wc/webpack-index-html-plugin@1.4.1) (2019-09-11) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# [1.4.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.3.3...@open-wc/webpack-index-html-plugin@1.4.0) (2019-08-27) - - -### Features - -* **webpack-index-html-plugin:** enable the use of webpack watchers ([e4833eb](https://github.com/open-wc/open-wc/commit/e4833eb)) - - - - - -## [1.3.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.3.2...@open-wc/webpack-index-html-plugin@1.3.3) (2019-08-21) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.3.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.3.1...@open-wc/webpack-index-html-plugin@1.3.2) (2019-08-20) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.3.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.3.0...@open-wc/webpack-index-html-plugin@1.3.1) (2019-08-18) - - -### Bug Fixes - -* **webpack-index-html-plugin:** create entry without extension ([0996821](https://github.com/open-wc/open-wc/commit/0996821)) - - - - - -# [1.3.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.15...@open-wc/webpack-index-html-plugin@1.3.0) (2019-08-14) - - -### Features - -* **eslint-config:** update dependencies ([52909e8](https://github.com/open-wc/open-wc/commit/52909e8)) - - - - - -## [1.2.15](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.14...@open-wc/webpack-index-html-plugin@1.2.15) (2019-08-13) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.14](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.13...@open-wc/webpack-index-html-plugin@1.2.14) (2019-08-13) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.13](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.12...@open-wc/webpack-index-html-plugin@1.2.13) (2019-08-05) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.12](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.11...@open-wc/webpack-index-html-plugin@1.2.12) (2019-08-04) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.11](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.10...@open-wc/webpack-index-html-plugin@1.2.11) (2019-07-26) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.10](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.9...@open-wc/webpack-index-html-plugin@1.2.10) (2019-07-24) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.9](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.8...@open-wc/webpack-index-html-plugin@1.2.9) (2019-07-22) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.8](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.7...@open-wc/webpack-index-html-plugin@1.2.8) (2019-07-19) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.7](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.6...@open-wc/webpack-index-html-plugin@1.2.7) (2019-07-15) - - -### Bug Fixes - -* adopt to new testing-karma setup ([bdcc717](https://github.com/open-wc/open-wc/commit/bdcc717)) - - - - - -## [1.2.6](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.5...@open-wc/webpack-index-html-plugin@1.2.6) (2019-07-13) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.5](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.4...@open-wc/webpack-index-html-plugin@1.2.5) (2019-07-08) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.4](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.3...@open-wc/webpack-index-html-plugin@1.2.4) (2019-07-08) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.3](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.2...@open-wc/webpack-index-html-plugin@1.2.3) (2019-07-08) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -## [1.2.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.1...@open-wc/webpack-index-html-plugin@1.2.2) (2019-07-02) - - -### Bug Fixes - -* **es-dev-server:** don't call next on non-2xx response ([f3e865a](https://github.com/open-wc/open-wc/commit/f3e865a)) - - - - - -## [1.2.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.2.0...@open-wc/webpack-index-html-plugin@1.2.1) (2019-07-02) - - -### Bug Fixes - -* **webpack-index-html-plugin:** improve error message ([f4c93db](https://github.com/open-wc/open-wc/commit/f4c93db)) - - - - - -# [1.2.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.1.2...@open-wc/webpack-index-html-plugin@1.2.0) (2019-07-02) - - -### Features - -* add es dev server ([2c6a0a8](https://github.com/open-wc/open-wc/commit/2c6a0a8)) - - - - - -## [1.1.2](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.1.1...@open-wc/webpack-index-html-plugin@1.1.2) (2019-06-30) - - -### Bug Fixes - -* **webpack-index-html-plugin:** multi build now works on windows ([#522](https://github.com/open-wc/open-wc/issues/522)) ([b24723a](https://github.com/open-wc/open-wc/commit/b24723a)) - - - - - -## [1.1.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.1.0...@open-wc/webpack-index-html-plugin@1.1.1) (2019-06-23) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# [1.1.0](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.0.1...@open-wc/webpack-index-html-plugin@1.1.0) (2019-06-23) - - -### Features - -* **building-rollup:** add rollup-index-html-plugin ([#510](https://github.com/open-wc/open-wc/issues/510)) ([2ac2d19](https://github.com/open-wc/open-wc/commit/2ac2d19)) - - - - - -## [1.0.1](https://github.com/open-wc/open-wc/compare/@open-wc/webpack-index-html-plugin@1.0.0...@open-wc/webpack-index-html-plugin@1.0.1) (2019-06-18) - -**Note:** Version bump only for package @open-wc/webpack-index-html-plugin - - - - - -# 1.0.0 (2019-06-14) - - -### Features - -* utils and webpack plugin for an index.html entrypoint ([#474](https://github.com/open-wc/open-wc/issues/474)) ([c382cc7](https://github.com/open-wc/open-wc/commit/c382cc7)) - - -### BREAKING CHANGES - -* Replaced webpack html plugin with index html plugin diff --git a/packages/webpack-index-html-plugin/README.md b/packages/webpack-index-html-plugin/README.md index 8ba0a479..91adf7c8 100644 --- a/packages/webpack-index-html-plugin/README.md +++ b/packages/webpack-index-html-plugin/README.md @@ -1,263 +1 @@ -# Webpack Index HTML Plugin - -Webpack plugin to make webpack understand your index.html. - -[//]: # 'AUTO INSERT HEADER PREPUBLISH' - -1. Takes in a standard index.html: - -```html - - - My app - - - - -

- - Hello world! - -

- - - - - - - -``` - -2. Extracts any ` -``` - - -4. Optionally adds a loader script for conditionally loading polyfills and/or a separate build for older browsers. - -Note that only module scripts with a `src` attribute are used as entrypoints, regular scripts and inline modules are minified but not parsed by webpack. - -## Usage - -To use this plugin, add it to your webpack configuration and set your index.html as entrypoint: - -```js -const path = require('path'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[chunkhash].js', - chunkFilename: '[name].[chunkhash].js', - }, - - plugins: [new WebpackIndexHTMLPlugin()], -}; -``` - -## Configuration - -### Polyfills - -> Note when using `@open-wc/building-webpack` polyfills are already configured for you. - -Depending on which browser you need to support you may need to polyfill certain browser features. To keep your bundles small, we don't serve any polyfills by default. You can enable polyfills in the configuration. - -When enabling polyfills a small loader script is injected to your index.html. Polyfills are loaded based on feature detection. This causes a small delay in loading your app. We mediate this by adding a preload link during the build. - -To enable polyfills: - -```js -new WebpackIndexHTMLPlugin({ - polyfills: { - hashPolyfills: true, - coreJs: true, - regeneratorRuntime: true, - webcomponents: true, - fetch: true, - intersectionObserver: true, - }, -}); -``` - -`core-js` polyfills many language features such as `Promise`, `Symbol` and `String.prototype.includes`. `regeneratorRuntime` is necessary when you compile `async await` code which is transpiled to javascript ES5. These two polyfills are mainly for supporting legacy browsers. They are only loaded on browsers which don't support modules, such as IE11. - -The rest of the polyfills target specific browser features, see their documentation for more info: - -- [core-js](https://github.com/zloirock/core-js) -- [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime) -- [webcomponents](https://github.com/webcomponents/webcomponentsjs) -- [fetch](https://github.com/github/fetch) -- [intersection-observer](https://github.com/w3c/IntersectionObserver) - -If you need a polyfill which is not on this list, consider creating an issue so that we can add it. You can also specify custom polyfills: - -```js -new WebpackIndexHTMLPlugin({ - polyfills: { - coreJs: true, - customPolyfills: [ - { - // the name of your polyfill - name: 'my-feature', - // expression which is run in the browser to determine if the polyfill should be loaded - test: "'myFeature' in window", - // path to your polyfill - path: require.resolve('my-feature-polyfill/dist/bundled.js'), - // path to the sourcemaps of your polyfill. optional - sourcemapPath: require.resolve('my-feature-polyfill/dist/bundled.js.map'), - }, - ], - }, -}) - -You can disable the content hash in the distributed polyfill filenames by setting `polyfillsHash` to `false`. -``` - -### Multi (legacy and modern) build - -> Note when using `@open-wc/building-webpack/modern-and-legacy-config` the multi build is already configured for you - -If you need to support non-modern browsers, such IE11 or older versions of chrome, safari and firefox, it's better to create multiple builds of your app. - -You can make one build for modern browsers using modern syntax and features, and one build for legacy browsers compiled to javascript ES5 and with more polyfills loaded. This way you don't penalize all your users for your lowest browser target. - -To create multiple webpack builds, export an array of webpack configs instead of a single config. Set the `multiBuild` option in both instances of the plugin and set `legacy` option in the legacy build: - -```javascript -const path = require('path'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); - -module.exports = [ - { - entry: path.resolve(__dirname, './index.html'), - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - polyfills: { - coreJs: true, - regeneratorRuntime: true, - webcomponents: true, - }, - }), - ], - }, - - { - entry: path.resolve(__dirname, './index.html'), - module: { - rules: [ - // Note: You will probably also want to configure babel for the legacy build. - // this is not a complete example, you will need to add more configuration for babel - { test: /\.js/, use: { loader: 'babel-loader' } }, - ], - }, - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - legacy: true, - }), - ], - }, -]; -``` - -For the legacy build you do not need to configure any polyfills, as these are already injected by the modern build. - -You will probably need to use babel as well to transpile your code to ES5. Remember to change the browser targets for the modern and legacy build accordingly. For example latest 2 of the major browsers for modern and IE11 for the legac build. - -### Minification - -We use [html-minifier](https://github.com/kangax/html-minifier) for minifcation with a default configuration. You can adjust this configuration by passing a minify object: - -```js -new WebpackIndexHTMLPlugin({ - minify: { - // minify options - }, -}); -``` - -The options object is passed as is to `html-minifier`. See the documentation of [html-minifier](https://github.com/kangax/html-minifier) for all possible minification options. - -It is also possible to turn off minification completely by passing minify: - -```js -new WebpackIndexHTMLPlugin({ - minify: false, -}); -``` - -### Non index.html entrypoints - -You can use this plugin without an index.html plugin if you still want to make use of the polyfilling features. You can do this by adding a custom template function: - -```js -const path = require('path'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './my-app.js'), - - output: { - filename: '[name].[chunkhash].js', - chunkFilename: '[name].[chunkhash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - template: ({ assets, entries, legacyEntries, variation }) => ` - - - - - `, - }), - ], -}; -``` - -### CSP - -When loading polyfills we inject a small script in your index.html. If you need CSP you can separate the script in a separate file: - -```js -const path = require('path'); -const WebpackIndexHTMLPlugin = require('@open-wc/webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './my-app.js'), - - output: { - filename: '[name].[chunkhash].js', - chunkFilename: '[name].[chunkhash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - polyfills: { - webcomponents: true, - }, - loader: 'external', - }), - ], -}; -``` - -The template function receives the project's `assets` and `entries`. If applicable it also receives the `legacyEntries` and `variation`. +I move into the legacy repository [webpack-index-html-plugin](https://github.com/open-wc/legacy/tree/master/packages/webpack-index-html-plugin) we now recommend rollup over webpack diff --git a/packages/webpack-index-html-plugin/package.json b/packages/webpack-index-html-plugin/package.json deleted file mode 100644 index c41ee9d0..00000000 --- a/packages/webpack-index-html-plugin/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@open-wc/webpack-index-html-plugin", - "version": "1.7.14", - "publishConfig": { - "access": "public" - }, - "description": "Plugin for generating a index html with webpack", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/open-wc/open-wc.git", - "directory": "packages/webpack-index-html-plugin" - }, - "author": "open-wc", - "homepage": "https://github.com/open-wc/open-wc/tree/master/packages/webpack-index-html-plugin", - "main": "webpack-index-html-plugin.js", - "scripts": {}, - "files": [ - "*.js", - "src" - ], - "keywords": [ - "webpack", - "plugin", - "config", - "polyfills" - ], - "peerDependencies": { - "webpack": "^4.28.0" - }, - "dependencies": { - "@open-wc/building-utils": "^2.18.3", - "deepmerge": "^4.2.2", - "parse5": "^5.1.1" - }, - "devDependencies": { - "@webcomponents/webcomponentsjs": "^2.4.0", - "intersection-observer": "^0.7.0", - "memory-fs": "^0.4.1", - "mkdirp": "^0.5.1", - "webpack": "^4.28.0", - "whatwg-fetch": "^3.0.0" - } -} diff --git a/packages/webpack-index-html-plugin/src/create-entrypoints.js b/packages/webpack-index-html-plugin/src/create-entrypoints.js deleted file mode 100644 index 6b01ef0c..00000000 --- a/packages/webpack-index-html-plugin/src/create-entrypoints.js +++ /dev/null @@ -1,117 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); -const MultiEntryPlugin = require('webpack/lib/MultiEntryPlugin'); -const { extractResources } = require('@open-wc/building-utils/index-html'); - -function getFilenameWithoutExtension(filePath) { - const filename = path.basename(filePath); - return filename.substring(0, filename.length - path.extname(filename).length); -} - -function createEntrypoints(compiler, context, entry, config, createError) { - let index; - let nonAppEntryPoints; - - // entry is an array when running webpack dev server, so we handle it. However we should not encourage/communicate that people can - // use an array - if (Array.isArray(entry)) { - const indices = entry.filter(e => e.endsWith('index.html')); - nonAppEntryPoints = entry.filter(e => !e.endsWith('index.html')); - - if (indices.length === 0) { - throw createError( - 'Entry must be a string pointing to a index.html file. For multiple entry points add module scripts to your index.html.', - ); - } else if (indices.length > 1) { - throw createError('There should be only one index.html entrypoint.'); - } else { - [index] = indices; - } - } else if (typeof entry !== 'string') { - throw createError( - 'Entry must be a string pointing to a index.html file. For multiple entry points add module scripts to your index.html.', - ); - } else { - if (!entry.endsWith('index.html')) { - throw createError( - 'Entry must be a single index.html file. If you wish to use a javascript file as entrypoint you need to set a HTML template function.', - ); - } - index = entry; - } - - if (!fs.existsSync(index)) { - throw createError(`Could not find entry file: ${index}`); - } - - const indexFolder = path.dirname(index); - const indexHTMLString = fs.readFileSync(index, 'utf-8'); - const resources = extractResources(indexHTMLString); - - if (resources.jsModules.length === 0) { - throw createError( - 'Could not find any js modules in entry point. Add a - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/external-loader/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/external-loader/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/external-loader/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/external-loader/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/external-loader/webpack.config.js deleted file mode 100644 index 84afd2f4..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/external-loader/webpack.config.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = [ - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: 'legacy/[name].[contenthash].js', - chunkFilename: 'legacy/[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - legacy: true, - }), - ], - }, - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - loader: 'external', - polyfills: { - coreJs: true, - webcomponents: true, - }, - }), - ], - }, -]; diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/app.js b/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/index.html b/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/webpack.config.js deleted file mode 100644 index a3dfc2ac..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy-multi-index/webpack.config.js +++ /dev/null @@ -1,59 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = [ - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: 'legacy/[name].[contenthash].js', - chunkFilename: 'legacy/[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - legacy: true, - multiIndex: { - variations: [ - { name: 'en-GB' }, - { name: 'nl-NL' }, - { name: 'fr-FR' }, - { name: 'demo', sharedEntry: 'en-GB' }, - ], - }, - }), - ], - }, - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - polyfills: { - coreJs: true, - webcomponents: true, - }, - multiIndex: { - fallback: 'en-GB', - variations: [ - { name: 'en-GB' }, - { name: 'nl-NL' }, - { name: 'fr-FR' }, - { name: 'demo', sharedEntry: 'en-GB' }, - ], - transformIndex: (index, variation, fallback) => { - const lang = fallback || variation === 'demo' ? 'en-GB' : variation; - return index.replace('', ``); - }, - }, - }), - ], - }, -]; diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy/app.js b/packages/webpack-index-html-plugin/test/fixtures/legacy/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy/index.html b/packages/webpack-index-html-plugin/test/fixtures/legacy/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/legacy/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/legacy/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/legacy/webpack.config.js deleted file mode 100644 index 5b97a99c..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/legacy/webpack.config.js +++ /dev/null @@ -1,38 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = [ - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: 'legacy/[name].[contenthash].js', - chunkFilename: 'legacy/[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - legacy: true, - }), - ], - }, - { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiBuild: true, - polyfills: { - coreJs: true, - webcomponents: true, - }, - }), - ], - }, -]; diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/app.js b/packages/webpack-index-html-plugin/test/fixtures/manual-entry/app.js deleted file mode 100644 index c08aa44d..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/index.html b/packages/webpack-index-html-plugin/test/fixtures/manual-entry/index.html deleted file mode 100644 index adb28d07..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/manual-entry/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/manual-entry/webpack.config.js deleted file mode 100644 index 05508524..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-entry/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './app.js'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - template: () => fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf-8'), - }), - ], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/app.js b/packages/webpack-index-html-plugin/test/fixtures/manual-inject/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/index.html b/packages/webpack-index-html-plugin/test/fixtures/manual-inject/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/manual-inject/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/manual-inject/webpack.config.js deleted file mode 100644 index f9d8dd83..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/manual-inject/webpack.config.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require('path'); - -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './app.js'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - inject: false, - template: ({ entries }) => ` - - - ${entries.map(entry => ``).join('')} - -

Template factory

- - ${entries.map(entry => ``).join('')} - - - `, - }), - ], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/app.js b/packages/webpack-index-html-plugin/test/fixtures/multi-entry/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/index.html b/packages/webpack-index-html-plugin/test/fixtures/multi-entry/index.html deleted file mode 100644 index 9c875bc9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/multi-entry/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/second-entry-point.js b/packages/webpack-index-html-plugin/test/fixtures/multi-entry/second-entry-point.js deleted file mode 100644 index e42ede9e..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/second-entry-point.js +++ /dev/null @@ -1 +0,0 @@ -console.log('second entry point'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/multi-entry/webpack.config.js deleted file mode 100644 index ba35559b..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-entry/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [new WebpackIndexHTMLPlugin()], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-index/app.js b/packages/webpack-index-html-plugin/test/fixtures/multi-index/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-index/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-index/index.html b/packages/webpack-index-html-plugin/test/fixtures/multi-index/index.html deleted file mode 100644 index 166d2d06..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-index/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-index/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/multi-index/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-index/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/multi-index/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/multi-index/webpack.config.js deleted file mode 100644 index fa455908..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/multi-index/webpack.config.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - multiIndex: { - fallback: 'en-GB', - variations: [ - { name: 'en-GB' }, - { name: 'nl-NL' }, - { name: 'fr-FR' }, - { name: 'demo', sharedEntry: 'en-GB' }, - ], - transformIndex: (index, variation, fallback) => { - const lang = fallback || variation === 'demo' ? 'en-GB' : variation; - return index.replace('', ``); - }, - }, - }), - ], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/app.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/index.html b/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/webpack.config.js deleted file mode 100644 index 3ec3c9f3..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills-no-hash/webpack.config.js +++ /dev/null @@ -1,22 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - polyfills: { - hashPolyfills: false, - coreJs: true, - regeneratorRuntime: true, - webcomponents: true, - }, - }), - ], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills/app.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills/index.html b/packages/webpack-index-html-plugin/test/fixtures/polyfills/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/polyfills/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/polyfills/webpack.config.js deleted file mode 100644 index 8f6b76f8..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/polyfills/webpack.config.js +++ /dev/null @@ -1,21 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [ - new WebpackIndexHTMLPlugin({ - polyfills: { - coreJs: true, - regeneratorRuntime: true, - webcomponents: true, - }, - }), - ], -}; diff --git a/packages/webpack-index-html-plugin/test/fixtures/single-entry/app.js b/packages/webpack-index-html-plugin/test/fixtures/single-entry/app.js deleted file mode 100644 index 0984e3ed..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/single-entry/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -console.log('my app'); -import('./lazy.js'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/single-entry/index.html b/packages/webpack-index-html-plugin/test/fixtures/single-entry/index.html deleted file mode 100644 index 209b98a9..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/single-entry/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - My app - - - - -

- - Hello world! - -

- - - - - - - \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/fixtures/single-entry/lazy.js b/packages/webpack-index-html-plugin/test/fixtures/single-entry/lazy.js deleted file mode 100644 index 82360aef..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/single-entry/lazy.js +++ /dev/null @@ -1 +0,0 @@ -console.log('my lazy'); diff --git a/packages/webpack-index-html-plugin/test/fixtures/single-entry/webpack.config.js b/packages/webpack-index-html-plugin/test/fixtures/single-entry/webpack.config.js deleted file mode 100644 index ba35559b..00000000 --- a/packages/webpack-index-html-plugin/test/fixtures/single-entry/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const path = require('path'); -const WebpackIndexHTMLPlugin = require('../../../webpack-index-html-plugin'); - -module.exports = { - entry: path.resolve(__dirname, './index.html'), - - output: { - filename: '[name].[contenthash].js', - chunkFilename: '[name].[contenthash].js', - }, - - plugins: [new WebpackIndexHTMLPlugin()], -}; diff --git a/packages/webpack-index-html-plugin/test/integration.test.js b/packages/webpack-index-html-plugin/test/integration.test.js deleted file mode 100644 index 0ad433db..00000000 --- a/packages/webpack-index-html-plugin/test/integration.test.js +++ /dev/null @@ -1,94 +0,0 @@ -/* eslint-disable import/no-dynamic-require, global-require */ -const webpack = require('webpack'); -const path = require('path'); -const fs = require('fs'); -const os = require('os'); -const { testSnapshots } = require('@open-wc/building-utils/testing-helpers/snapshots'); -const { PLUGIN_NAME } = require('../src/utils'); - -const fixturesDir = path.join(__dirname, 'fixtures'); - -function touchAppFile(name) { - const appPath = path.join(fixturesDir, name, 'app.js'); - const now = new Date(); - fs.utimesSync(appPath, now, now); -} - -function compileAsync(config, addWatcher, name) { - return new Promise((resolve, reject) => { - const compiler = webpack({ - ...config, - output: { - ...config.output, - path: os.tmpdir(), - }, - }); - let finished = !addWatcher; - let watching; - const cb = (err, stats) => { - if (err) { - reject(err); - watching && watching.close(); - } else if (finished) { - resolve(stats); - watching && watching.close(); - } - }; - - if (addWatcher) { - watching = compiler.watch({}, cb); - compiler.hooks.afterCompile.tap(PLUGIN_NAME, () => { - if (!finished) { - finished = true; - touchAppFile(name); - } - return true; - }); - } else { - compiler.run(cb); - } - }); -} - -async function testSnapshot(name, configFilePath, addWatcher = false) { - const snapshotDir = path.join(__dirname, 'snapshots', name); - const requireResult = require(configFilePath); - const configs = Array.isArray(requireResult) ? requireResult : [requireResult]; - - /** @type {{ [key: string]: string }} */ - const outputFiles = {}; - - // multi build - // note: this should be sequential, not parallel - /* eslint-disable no-restricted-syntax, no-await-in-loop */ - for (const config of configs) { - const stats = await compileAsync(config, addWatcher, name); - - Object.entries(stats.compilation.assets).forEach(([filePath, file]) => { - outputFiles[filePath] = file.source(); - }); - } - - testSnapshots(snapshotDir, outputFiles); -} - -const testCases = fs.readdirSync(fixturesDir); - -describe('webpack-index-html-plugin integration test', () => { - testCases.forEach(name => { - const configFilePath = path.join(fixturesDir, name, 'webpack.config.js'); - if (!fs.existsSync(configFilePath)) { - return; - } - - it(`test case ${name}`, async function it() { - this.timeout(1000 * 10); - await testSnapshot(name, configFilePath); - }); - - it(`test case ${name} with watcher`, async function it() { - this.timeout(1000 * 10); - await testSnapshot(name, configFilePath, true); - }); - }); -}); diff --git a/packages/webpack-index-html-plugin/test/snapshots/external-loader/1.6460eaa1be9cec799f97.js b/packages/webpack-index-html-plugin/test/snapshots/external-loader/1.6460eaa1be9cec799f97.js deleted file mode 100644 index b62e19ed..00000000 --- a/packages/webpack-index-html-plugin/test/snapshots/external-loader/1.6460eaa1be9cec799f97.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(o,n){console.log("my lazy")}]]); \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/snapshots/external-loader/app.3a93364ee90208c7ab18.js b/packages/webpack-index-html-plugin/test/snapshots/external-loader/app.3a93364ee90208c7ab18.js deleted file mode 100644 index 16288906..00000000 --- a/packages/webpack-index-html-plugin/test/snapshots/external-loader/app.3a93364ee90208c7ab18.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];aMy app

Hello world!

\ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/1.6460eaa1be9cec799f97.js b/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/1.6460eaa1be9cec799f97.js deleted file mode 100644 index b62e19ed..00000000 --- a/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/1.6460eaa1be9cec799f97.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(o,n){console.log("my lazy")}]]); \ No newline at end of file diff --git a/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/app.dc126e48488aa981a60a.js b/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/app.dc126e48488aa981a60a.js deleted file mode 100644 index d16ba397..00000000 --- a/packages/webpack-index-html-plugin/test/snapshots/external-loader/legacy/app.dc126e48488aa981a60a.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function t(t){for(var r,o,u=t[0],i=t[1],a=0,l=[];a"+t+""},d=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(n){}var t,r;d=o?function(t){t.write(v("")),t.close();var r=t.parentWindow.Object;return t=null,r}(o):((r=f("iframe")).style.display="none",c.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F);for(var e=a.length;e--;)delete d[l][a[e]];return d()};u[h]=!0,t.exports=Object.create||function create(t,r){var e;return null!==t?(g[l]=n(t),e=new g,g[l]=null,e[h]=t):e=d(),r===qt?e:i(e,r)}},function(t,r,e){var n=e(5),a=e(19),u=e(20),c=e(51);t.exports=n?Object.defineProperties:function defineProperties(t,r){u(t);for(var e,n=c(r),o=n.length,i=0;i>8&255]},L=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},C=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},D=function(t){return k(t,23,4)},B=function(t){return k(t,52,8)},q=function(t,r){y(t[I],r,{get:function(){return w(this)[r]}})},z=function(t,r,e,n){var o=p(e),i=w(t);if(i.byteLength>24)},setUint8:function setUint8(t,r){J.call(this,t,r<<24>>24)}},{unsafe:!0})}else R=function ArrayBuffer(t){f(this,R,A);var r=p(t);S(this,{bytes:m.call(new Array(r),0),byteLength:r}),i||(this.byteLength=r)},T=function DataView(t,r,e){f(this,T,E),f(t,R,E);var n=w(t).byteLength,o=s(r);if(o<0||n>24},getUint8:function getUint8(t){return z(this,1,t)[0]},getInt16:function getInt16(t){var r=z(this,2,t,1>16},getUint16:function getUint16(t){var r=z(this,2,t,1>>0},getFloat32:function getFloat32(t){return N(z(this,4,t,1>1,s=23===r?g(2,-24)-g(2,-77):0,l=t<0||0===t&&1/t<0?1:0,p=0;for((t=h(t))!=t||t===1/0?(o=t!=t?1:0,n=c):(n=v(d(t)/y),t*(i=g(2,-n))<1&&(n--,i*=2),2<=(t+=1<=n+f?s/i:s*g(2,1-f))*i&&(n++,i/=2),c<=n+f?(o=0,n=c):1<=n+f?(o=(t*i-1)*g(2,r),n+=f):(o=t*g(2,f-1)*g(2,r),n=0));8<=r;a[p++]=255&o,o/=256,r-=8);for(n=n<>1,u=o-7,c=n-1,f=t[c--],s=127&f;for(f>>=7;0>=-u,u+=r;0>>=1)&&(r+=r))1&n&&(e+=r);return e}},function(t,r,e){var n=e(2),o=e(6),i=e(48),a=e(13);n({target:"Date",proto:!0,forced:o(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})},{toJSON:function toJSON(t){var r=i(this),e=a(r);return"number"!=typeof e||isFinite(e)?r.toISOString():null}})},function(t,r,e){var n=e(18),o=e(153),i=e(54)("toPrimitive"),a=Date.prototype;i in a||n(a,i,o)},function(t,r,e){var n=e(20),o=e(13);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),"number"!==t)}},function(t,r,e){var n=e(21),o=Date.prototype,i="Invalid Date",a="toString",u=o[a],c=o.getTime;new Date(NaN)+""!=i&&n(o,a,function toString(){var t=c.call(this);return t==t?u.call(this):i})},function(t,r,e){e(2)({target:"Function",proto:!0},{bind:e(156)})},function(t,r,e){var i=e(60),a=e(14),u=[].slice,c={};t.exports=Function.bind||function bind(r){var e=i(this),n=u.call(arguments,1),o=function bound(){var t=n.concat(u.call(arguments));return this instanceof o?function(t,r,e){if(!(r in c)){for(var n=[],o=0;o>>=0)?31-o(i(t+.5)*a):32}})},function(t,r,e){var n=e(2),o=e(177),i=Math.cosh,a=Math.abs,u=Math.E;n({target:"Math",stat:!0,forced:!i||i(710)===Infinity},{cosh:function cosh(t){var r=o(a(t)-1)+1;return(r+1/(r*u*u))*(u/2)}})},function(t,r){var e=Math.expm1,n=Math.exp;t.exports=!e||22025.465794806718>>16)*a+i*(e&o>>>16)<<16>>>0)}})},function(t,r,e){var n=e(2),o=Math.log,i=Math.LOG10E;n({target:"Math",stat:!0},{log10:function log10(t){return o(t)*i}})},function(t,r,e){e(2)({target:"Math",stat:!0},{log1p:e(170)})},function(t,r,e){var n=e(2),o=Math.log,i=Math.LN2;n({target:"Math",stat:!0},{log2:function log2(t){return o(t)/i}})},function(t,r,e){e(2)({target:"Math",stat:!0},{sign:e(174)})},function(t,r,e){var n=e(2),o=e(6),i=e(177),a=Math.abs,u=Math.exp,c=Math.E;n({target:"Math",stat:!0,forced:o(function(){return-2e-17!=Math.sinh(-2e-17)})},{sinh:function sinh(t){return a(t=+t)<1?(i(t)-i(-t))/2:(u(t-1)-u(-t-1))*(c/2)}})},function(t,r,e){var n=e(2),o=e(177),i=Math.exp;n({target:"Math",stat:!0},{tanh:function tanh(t){var r=o(t=+t),e=o(-t);return r==Infinity?1:e==Infinity?-1:(r-e)/(i(t)+i(-t))}})},function(t,r,e){e(57)(Math,"Math",!0)},function(t,r,e){var n=e(2),o=Math.ceil,i=Math.floor;n({target:"Math",stat:!0},{trunc:function trunc(t){return(0>>0||(u.test(e)?16:10))}:a},function(t,r,e){var n=e(2),h=e(40),g=e(208),v=e(150),o=e(6),i=1..toFixed,d=Math.floor,y=function(t,r,e){return 0===r?e:r%2==1?y(t,r-1,e*t):y(t*t,r/2,e)};n({target:"Number",proto:!0,forced:i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!o(function(){i.call({})})},{toFixed:function toFixed(t){var r,e,n,o,i=g(this),a=h(t),u=[0,0,0,0,0,0],c="",f="0",s=function(t,r){for(var e=-1,n=r;++e<6;)u[e]=(n+=t*u[e])%1e7,n=d(n/1e7)},l=function(t){for(var r=6,e=0;0<=--r;)u[r]=d((e+=u[r])/t),e=e%t*1e7},p=function(){for(var t=6,r="";0<=--t;)if(""!==r||0===t||0!==u[t]){var e=String(u[t]);r=""===r?e:r+v.call("0",7-e.length)+e}return r};if(a<0||20>10),r%1024+56320))}return e.join("")}})},function(t,r,e){var n=e(2),o=e(280),i=e(12);n({target:"String",proto:!0,forced:!e(281)("includes")},{includes:function includes(t){return!!~String(i(this)).indexOf(o(t),1")}),y="$0"==="a".replace(/./,"$0"),n=p("replace"),m=!!/./[n]&&""===/./[n]("a","$0"),b=!l(function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(e,t,r,n){var o=p(e),i=!l(function(){var t={};return t[o]=function(){return 7},7!=""[e](t)}),a=i&&!l(function(){var t=!1,r=/a/;return"split"===e&&((r={constructor:{}}).constructor[v]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t});if(!i||!a||"replace"===e&&(!d||!y||m)||"split"===e&&!b){var u=/./[o],c=r(o,""[e],function(t,r,e,n,o){return r.exec===h?i&&!o?{done:!0,value:u.call(r,e,n)}:{done:!0,value:t.call(e,r,n)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:m}),f=c[1];s(String.prototype,e,c[0]),s(RegExp.prototype,o,2==t?function(t,r){return f.call(t,this,r)}:function(t){return f.call(t,this)})}n&&g(RegExp.prototype[o],"sham",!0)}},function(t,r,e){var n=e(278).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},function(t,r,e){var o=e(11),i=e(271);t.exports=function(t,r){var e=t.exec;if("function"==typeof e){var n=e.call(t,r);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==o(t))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(t,r)}},function(t,r,e){var n=e(2),o=e(111),i=e(12),f=e(39),a=e(60),s=e(20),u=e(11),c=e(267),l=e(268),p=e(18),h=e(6),g=e(54),v=e(144),d=e(287),y=e(25),m=e(29),b=g("matchAll"),x="RegExp String",w=x+" Iterator",S=y.set,A=y.getterFor(w),E=RegExp.prototype,I=E.exec,O="".matchAll,M=!!O&&!h(function(){"a".matchAll(/./)}),R=o(function RegExpStringIterator(t,r,e,n){S(this,{type:w,regexp:t,string:r,global:e,unicode:n,done:!1})},x,function next(){var t=A(this);if(t.done)return{value:qt,done:!0};var r=t.regexp,e=t.string,n=function(t,r){var e,n=t.exec;if("function"!=typeof n)return I.call(t,r);if("object"!=typeof(e=n.call(t,r)))throw TypeError("Incorrect exec result");return e}(r,e);return null===n?{value:qt,done:t.done=!0}:t.global?(""==String(n[0])&&(r.lastIndex=d(e,f(r.lastIndex),t.unicode)),{value:n,done:!1}):{value:n,done:!(t.done=!0)}}),T=function(t){var r,e,n,o,i,a,u=s(this),c=String(t);return r=v(u,RegExp),(e=u.flags)===qt&&u instanceof RegExp&&!("flags"in E)&&(e=l.call(u)),n=e===qt?"":String(e),o=new r(r===RegExp?u.source:u,n),i=!!~n.indexOf("g"),a=!!~n.indexOf("u"),o.lastIndex=f(u.lastIndex),new R(o,c,i,a)};n({target:"String",proto:!0,forced:M},{matchAll:function matchAll(t){var r,e,n,o=i(this);if(null!=t){if(c(t)&&!~String(i("flags"in E?t.flags:l.call(t))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(M)return O.apply(o,arguments);if((e=t[b])===qt&&m&&"RegExp"==u(t)&&(e=T),null!=e)return a(e).call(t,o)}else if(M)return O.apply(o,arguments);return r=String(o),n=new RegExp(t,"g"),m?T.call(n,r):n[b](r)}}),m||b in E||p(E,b,T)},function(t,r,e){var n=e(2),o=e(149).end;n({target:"String",proto:!0,forced:e(291)},{padEnd:function padEnd(t){return o(this,t,1]*>)/g,v=/\$([$&'`]|\d\d?)/g;n("replace",2,function(o,w,S,t){var A=t.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,E=t.REPLACE_KEEPS_$0,I=A?"$":"$0";return[function replace(t,r){var e=i(this),n=t==qt?qt:t[o];return n!==qt?n.call(t,e,r):w.call(String(e),t,r)},function(t,r){if(!A&&E||"string"==typeof r&&-1===r.indexOf(I)){var e=S(w,t,this,r);if(e.done)return e.value}var n=O(t),o=String(this),i="function"==typeof r;i||(r=String(r));var a=n.global;if(a){var u=n.unicode;n.lastIndex=0}for(var c=[];;){var f=_(n,o);if(null===f)break;if(c.push(f),!a)break;""===String(f[0])&&(n.lastIndex=T(o,M(n.lastIndex),u))}for(var s,l="",p=0,h=0;h>>0;if(0==n)return[];if(t===qt)return[e];if(!s(t))return v.call(e,t,n);for(var o,i,a,u=[],c=0,f=new RegExp(t.source,(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":"")+"g");(o=p.call(f,e))&&!(c<(i=f.lastIndex)&&(u.push(e.slice(c,o.index)),1>>0;if(0==c)return[];if(0===o.length)return null===S(u,o)?[o]:[];for(var f=0,s=0,l=[];s"+o+""}},function(t,r,e){var n=e(6);t.exports=function(r){return n(function(){var t=""[r]('"');return t!==t.toLowerCase()||3>>0,i=e>>>0;return(r>>>0)+(n>>>0)+((o&i|(o|i)&~(o+i>>>0))>>>31)|0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{imulh:function imulh(t,r){var e=+t,n=+r,o=65535&e,i=65535&n,a=e>>16,u=n>>16,c=(a*i>>>0)+(o*i>>>16);return a*u+(c>>16)+((o*u>>>0)+(65535&c)>>16)}})},function(t,r,e){e(2)({target:"Math",stat:!0},{isubh:function isubh(t,r,e,n){var o=t>>>0,i=e>>>0;return(r>>>0)-(n>>>0)-((~o&i|~(o^i)&o-i>>>0)>>>31)|0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{RAD_PER_DEG:180/Math.PI})},function(t,r,e){var n=e(2),o=Math.PI/180;n({target:"Math",stat:!0},{radians:function radians(t){return t*o}})},function(t,r,e){e(2)({target:"Math",stat:!0},{scale:e(431)})},function(t,r,e){var n=e(2),o=e(20),i=e(196),a=e(111),u=e(25),c="Seeded Random",f=c+" Generator",s=u.set,l=u.getterFor(f),p=a(function SeededRandomGenerator(t){s(this,{type:f,seed:t%2147483647})},c,function next(){var t=l(this);return{value:(1073741823&(t.seed=(1103515245*t.seed+12345)%2147483647))/1073741823,done:!1}});n({target:"Math",stat:!0,forced:!0},{seededPRNG:function seededPRNG(t){var r=o(t).seed;if(!i(r))throw TypeError('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new p(r)}})},function(t,r,e){e(2)({target:"Math",stat:!0},{signbit:function signbit(t){return(t=+t)==t&&0==t?1/t==-Infinity:t<0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{umulh:function umulh(t,r){var e=+t,n=+r,o=65535&e,i=65535&n,a=e>>>16,u=n>>>16,c=(a*i>>>0)+(o*i>>>16);return a*u+(c>>>16)+((o*u>>>0)+(65535&c)>>>16)}})},function(t,r,e){var n=e(2),i=e(40),a=e(206),u="Invalid number representation",c=/^[\da-z]+$/;n({target:"Number",stat:!0},{fromString:function fromString(t,r){var e,n,o=1;if("string"!=typeof t)throw TypeError(u);if(!t.length)throw SyntaxError(u);if("-"==t.charAt(0)&&(o=-1,!(t=t.slice(1)).length))throw SyntaxError(u);if((e=r===qt?10:i(r))<2||36=I(256,5-r))return null}else if(255":1,"`":1}),K=c({},V,{"#":1,"?":1,"{":1,"}":1}),$=c({},K,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Y=function(t,r){var e=l(t,0);return 32>1,t+=b(t/r);455b((y-a)/l))throw RangeError(m);for(a+=(s-i)*l,i=s,r=0;ry)throw RangeError(m);if(e==i){for(var p=a,h=36;;h+=36){var g=h<=u?1:u+26<=h?26:h-u;if(p"+t+""},d=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(n){}var t,r;d=o?function(t){t.write(v("")),t.close();var r=t.parentWindow.Object;return t=null,r}(o):((r=f("iframe")).style.display="none",c.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F);for(var e=a.length;e--;)delete d[l][a[e]];return d()};u[h]=!0,t.exports=Object.create||function create(t,r){var e;return null!==t?(g[l]=n(t),e=new g,g[l]=null,e[h]=t):e=d(),r===qt?e:i(e,r)}},function(t,r,e){var n=e(5),a=e(19),u=e(20),c=e(51);t.exports=n?Object.defineProperties:function defineProperties(t,r){u(t);for(var e,n=c(r),o=n.length,i=0;i>8&255]},L=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},C=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},D=function(t){return k(t,23,4)},B=function(t){return k(t,52,8)},q=function(t,r){y(t[I],r,{get:function(){return w(this)[r]}})},z=function(t,r,e,n){var o=p(e),i=w(t);if(i.byteLength>24)},setUint8:function setUint8(t,r){J.call(this,t,r<<24>>24)}},{unsafe:!0})}else R=function ArrayBuffer(t){f(this,R,A);var r=p(t);S(this,{bytes:m.call(new Array(r),0),byteLength:r}),i||(this.byteLength=r)},T=function DataView(t,r,e){f(this,T,E),f(t,R,E);var n=w(t).byteLength,o=s(r);if(o<0||n>24},getUint8:function getUint8(t){return z(this,1,t)[0]},getInt16:function getInt16(t){var r=z(this,2,t,1>16},getUint16:function getUint16(t){var r=z(this,2,t,1>>0},getFloat32:function getFloat32(t){return N(z(this,4,t,1>1,s=23===r?g(2,-24)-g(2,-77):0,l=t<0||0===t&&1/t<0?1:0,p=0;for((t=h(t))!=t||t===1/0?(o=t!=t?1:0,n=c):(n=v(d(t)/y),t*(i=g(2,-n))<1&&(n--,i*=2),2<=(t+=1<=n+f?s/i:s*g(2,1-f))*i&&(n++,i/=2),c<=n+f?(o=0,n=c):1<=n+f?(o=(t*i-1)*g(2,r),n+=f):(o=t*g(2,f-1)*g(2,r),n=0));8<=r;a[p++]=255&o,o/=256,r-=8);for(n=n<>1,u=o-7,c=n-1,f=t[c--],s=127&f;for(f>>=7;0>=-u,u+=r;0>>=1)&&(r+=r))1&n&&(e+=r);return e}},function(t,r,e){var n=e(2),o=e(6),i=e(48),a=e(13);n({target:"Date",proto:!0,forced:o(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})},{toJSON:function toJSON(t){var r=i(this),e=a(r);return"number"!=typeof e||isFinite(e)?r.toISOString():null}})},function(t,r,e){var n=e(18),o=e(153),i=e(54)("toPrimitive"),a=Date.prototype;i in a||n(a,i,o)},function(t,r,e){var n=e(20),o=e(13);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),"number"!==t)}},function(t,r,e){var n=e(21),o=Date.prototype,i="Invalid Date",a="toString",u=o[a],c=o.getTime;new Date(NaN)+""!=i&&n(o,a,function toString(){var t=c.call(this);return t==t?u.call(this):i})},function(t,r,e){e(2)({target:"Function",proto:!0},{bind:e(156)})},function(t,r,e){var i=e(60),a=e(14),u=[].slice,c={};t.exports=Function.bind||function bind(r){var e=i(this),n=u.call(arguments,1),o=function bound(){var t=n.concat(u.call(arguments));return this instanceof o?function(t,r,e){if(!(r in c)){for(var n=[],o=0;o>>=0)?31-o(i(t+.5)*a):32}})},function(t,r,e){var n=e(2),o=e(177),i=Math.cosh,a=Math.abs,u=Math.E;n({target:"Math",stat:!0,forced:!i||i(710)===Infinity},{cosh:function cosh(t){var r=o(a(t)-1)+1;return(r+1/(r*u*u))*(u/2)}})},function(t,r){var e=Math.expm1,n=Math.exp;t.exports=!e||22025.465794806718>>16)*a+i*(e&o>>>16)<<16>>>0)}})},function(t,r,e){var n=e(2),o=Math.log,i=Math.LOG10E;n({target:"Math",stat:!0},{log10:function log10(t){return o(t)*i}})},function(t,r,e){e(2)({target:"Math",stat:!0},{log1p:e(170)})},function(t,r,e){var n=e(2),o=Math.log,i=Math.LN2;n({target:"Math",stat:!0},{log2:function log2(t){return o(t)/i}})},function(t,r,e){e(2)({target:"Math",stat:!0},{sign:e(174)})},function(t,r,e){var n=e(2),o=e(6),i=e(177),a=Math.abs,u=Math.exp,c=Math.E;n({target:"Math",stat:!0,forced:o(function(){return-2e-17!=Math.sinh(-2e-17)})},{sinh:function sinh(t){return a(t=+t)<1?(i(t)-i(-t))/2:(u(t-1)-u(-t-1))*(c/2)}})},function(t,r,e){var n=e(2),o=e(177),i=Math.exp;n({target:"Math",stat:!0},{tanh:function tanh(t){var r=o(t=+t),e=o(-t);return r==Infinity?1:e==Infinity?-1:(r-e)/(i(t)+i(-t))}})},function(t,r,e){e(57)(Math,"Math",!0)},function(t,r,e){var n=e(2),o=Math.ceil,i=Math.floor;n({target:"Math",stat:!0},{trunc:function trunc(t){return(0>>0||(u.test(e)?16:10))}:a},function(t,r,e){var n=e(2),h=e(40),g=e(208),v=e(150),o=e(6),i=1..toFixed,d=Math.floor,y=function(t,r,e){return 0===r?e:r%2==1?y(t,r-1,e*t):y(t*t,r/2,e)};n({target:"Number",proto:!0,forced:i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!o(function(){i.call({})})},{toFixed:function toFixed(t){var r,e,n,o,i=g(this),a=h(t),u=[0,0,0,0,0,0],c="",f="0",s=function(t,r){for(var e=-1,n=r;++e<6;)u[e]=(n+=t*u[e])%1e7,n=d(n/1e7)},l=function(t){for(var r=6,e=0;0<=--r;)u[r]=d((e+=u[r])/t),e=e%t*1e7},p=function(){for(var t=6,r="";0<=--t;)if(""!==r||0===t||0!==u[t]){var e=String(u[t]);r=""===r?e:r+v.call("0",7-e.length)+e}return r};if(a<0||20>10),r%1024+56320))}return e.join("")}})},function(t,r,e){var n=e(2),o=e(280),i=e(12);n({target:"String",proto:!0,forced:!e(281)("includes")},{includes:function includes(t){return!!~String(i(this)).indexOf(o(t),1")}),y="$0"==="a".replace(/./,"$0"),n=p("replace"),m=!!/./[n]&&""===/./[n]("a","$0"),b=!l(function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(e,t,r,n){var o=p(e),i=!l(function(){var t={};return t[o]=function(){return 7},7!=""[e](t)}),a=i&&!l(function(){var t=!1,r=/a/;return"split"===e&&((r={constructor:{}}).constructor[v]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t});if(!i||!a||"replace"===e&&(!d||!y||m)||"split"===e&&!b){var u=/./[o],c=r(o,""[e],function(t,r,e,n,o){return r.exec===h?i&&!o?{done:!0,value:u.call(r,e,n)}:{done:!0,value:t.call(e,r,n)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:m}),f=c[1];s(String.prototype,e,c[0]),s(RegExp.prototype,o,2==t?function(t,r){return f.call(t,this,r)}:function(t){return f.call(t,this)})}n&&g(RegExp.prototype[o],"sham",!0)}},function(t,r,e){var n=e(278).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},function(t,r,e){var o=e(11),i=e(271);t.exports=function(t,r){var e=t.exec;if("function"==typeof e){var n=e.call(t,r);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==o(t))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(t,r)}},function(t,r,e){var n=e(2),o=e(111),i=e(12),f=e(39),a=e(60),s=e(20),u=e(11),c=e(267),l=e(268),p=e(18),h=e(6),g=e(54),v=e(144),d=e(287),y=e(25),m=e(29),b=g("matchAll"),x="RegExp String",w=x+" Iterator",S=y.set,A=y.getterFor(w),E=RegExp.prototype,I=E.exec,O="".matchAll,M=!!O&&!h(function(){"a".matchAll(/./)}),R=o(function RegExpStringIterator(t,r,e,n){S(this,{type:w,regexp:t,string:r,global:e,unicode:n,done:!1})},x,function next(){var t=A(this);if(t.done)return{value:qt,done:!0};var r=t.regexp,e=t.string,n=function(t,r){var e,n=t.exec;if("function"!=typeof n)return I.call(t,r);if("object"!=typeof(e=n.call(t,r)))throw TypeError("Incorrect exec result");return e}(r,e);return null===n?{value:qt,done:t.done=!0}:t.global?(""==String(n[0])&&(r.lastIndex=d(e,f(r.lastIndex),t.unicode)),{value:n,done:!1}):{value:n,done:!(t.done=!0)}}),T=function(t){var r,e,n,o,i,a,u=s(this),c=String(t);return r=v(u,RegExp),(e=u.flags)===qt&&u instanceof RegExp&&!("flags"in E)&&(e=l.call(u)),n=e===qt?"":String(e),o=new r(r===RegExp?u.source:u,n),i=!!~n.indexOf("g"),a=!!~n.indexOf("u"),o.lastIndex=f(u.lastIndex),new R(o,c,i,a)};n({target:"String",proto:!0,forced:M},{matchAll:function matchAll(t){var r,e,n,o=i(this);if(null!=t){if(c(t)&&!~String(i("flags"in E?t.flags:l.call(t))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(M)return O.apply(o,arguments);if((e=t[b])===qt&&m&&"RegExp"==u(t)&&(e=T),null!=e)return a(e).call(t,o)}else if(M)return O.apply(o,arguments);return r=String(o),n=new RegExp(t,"g"),m?T.call(n,r):n[b](r)}}),m||b in E||p(E,b,T)},function(t,r,e){var n=e(2),o=e(149).end;n({target:"String",proto:!0,forced:e(291)},{padEnd:function padEnd(t){return o(this,t,1]*>)/g,v=/\$([$&'`]|\d\d?)/g;n("replace",2,function(o,w,S,t){var A=t.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,E=t.REPLACE_KEEPS_$0,I=A?"$":"$0";return[function replace(t,r){var e=i(this),n=t==qt?qt:t[o];return n!==qt?n.call(t,e,r):w.call(String(e),t,r)},function(t,r){if(!A&&E||"string"==typeof r&&-1===r.indexOf(I)){var e=S(w,t,this,r);if(e.done)return e.value}var n=O(t),o=String(this),i="function"==typeof r;i||(r=String(r));var a=n.global;if(a){var u=n.unicode;n.lastIndex=0}for(var c=[];;){var f=_(n,o);if(null===f)break;if(c.push(f),!a)break;""===String(f[0])&&(n.lastIndex=T(o,M(n.lastIndex),u))}for(var s,l="",p=0,h=0;h>>0;if(0==n)return[];if(t===qt)return[e];if(!s(t))return v.call(e,t,n);for(var o,i,a,u=[],c=0,f=new RegExp(t.source,(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":"")+"g");(o=p.call(f,e))&&!(c<(i=f.lastIndex)&&(u.push(e.slice(c,o.index)),1>>0;if(0==c)return[];if(0===o.length)return null===S(u,o)?[o]:[];for(var f=0,s=0,l=[];s"+o+""}},function(t,r,e){var n=e(6);t.exports=function(r){return n(function(){var t=""[r]('"');return t!==t.toLowerCase()||3>>0,i=e>>>0;return(r>>>0)+(n>>>0)+((o&i|(o|i)&~(o+i>>>0))>>>31)|0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{imulh:function imulh(t,r){var e=+t,n=+r,o=65535&e,i=65535&n,a=e>>16,u=n>>16,c=(a*i>>>0)+(o*i>>>16);return a*u+(c>>16)+((o*u>>>0)+(65535&c)>>16)}})},function(t,r,e){e(2)({target:"Math",stat:!0},{isubh:function isubh(t,r,e,n){var o=t>>>0,i=e>>>0;return(r>>>0)-(n>>>0)-((~o&i|~(o^i)&o-i>>>0)>>>31)|0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{RAD_PER_DEG:180/Math.PI})},function(t,r,e){var n=e(2),o=Math.PI/180;n({target:"Math",stat:!0},{radians:function radians(t){return t*o}})},function(t,r,e){e(2)({target:"Math",stat:!0},{scale:e(431)})},function(t,r,e){var n=e(2),o=e(20),i=e(196),a=e(111),u=e(25),c="Seeded Random",f=c+" Generator",s=u.set,l=u.getterFor(f),p=a(function SeededRandomGenerator(t){s(this,{type:f,seed:t%2147483647})},c,function next(){var t=l(this);return{value:(1073741823&(t.seed=(1103515245*t.seed+12345)%2147483647))/1073741823,done:!1}});n({target:"Math",stat:!0,forced:!0},{seededPRNG:function seededPRNG(t){var r=o(t).seed;if(!i(r))throw TypeError('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new p(r)}})},function(t,r,e){e(2)({target:"Math",stat:!0},{signbit:function signbit(t){return(t=+t)==t&&0==t?1/t==-Infinity:t<0}})},function(t,r,e){e(2)({target:"Math",stat:!0},{umulh:function umulh(t,r){var e=+t,n=+r,o=65535&e,i=65535&n,a=e>>>16,u=n>>>16,c=(a*i>>>0)+(o*i>>>16);return a*u+(c>>>16)+((o*u>>>0)+(65535&c)>>>16)}})},function(t,r,e){var n=e(2),i=e(40),a=e(206),u="Invalid number representation",c=/^[\da-z]+$/;n({target:"Number",stat:!0},{fromString:function fromString(t,r){var e,n,o=1;if("string"!=typeof t)throw TypeError(u);if(!t.length)throw SyntaxError(u);if("-"==t.charAt(0)&&(o=-1,!(t=t.slice(1)).length))throw SyntaxError(u);if((e=r===qt?10:i(r))<2||36=I(256,5-r))return null}else if(255":1,"`":1}),K=c({},V,{"#":1,"?":1,"{":1,"}":1}),$=c({},K,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Y=function(t,r){var e=l(t,0);return 32>1,t+=b(t/r);455b((y-a)/l))throw RangeError(m);for(a+=(s-i)*l,i=s,r=0;ry)throw RangeError(m);if(e==i){for(var p=a,h=36;;h+=36){var g=h<=u?1:u+26<=h?26:h-u;if(p\x20\t\r\n\f]+)/i.exec(t)|| -["",""])[1].toLowerCase()];if(D)for(var K=0;K"+t+"";y.body.innerHTML=t;for(a.a(y);this.content.firstChild;)k.call(this.content,this.content.firstChild);t=y.body;if(D)for(K=0;K"+this.innerHTML+""},set:function(t){if(this.parentNode){y.body.innerHTML=t;for(t=this.ownerDocument.createDocumentFragment();y.body.firstChild;)l.call(t, -y.body.firstChild);m.call(this.parentNode,t,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};n(a.prototype);I(a.prototype);a.a=function(p){p=b(p,"template");for(var t=0,D=p.length,K;t]/g,cb=function(p){switch(p){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}};v=function(p){for(var t={},D=0;D";break a;case Node.TEXT_NODE:z=z.data;z=R&&db[R.localName]? -z:z.replace(Xb,cb);break a;case Node.COMMENT_NODE:z="\x3c!--"+z.data+"--\x3e";break a;default:throw window.console.error(z),Error("not implemented");}}D+=z}return D}}if(c||M){a.b=function(p,t){var D=f.call(p,!1);this.U&&this.U(D);t&&(l.call(D.content,f.call(p.content,!0)),u(D.content,p.content));return D};var u=function(p,t){if(t.querySelectorAll&&(t=b(t,"template"),0!==t.length)){p=b(p,"template");for(var D=0,K=p.length,aa,ja;D]/g;function Tb(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function Ub(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:h=h.data;h=k&&Wb[k.localName]?h:h.replace(Sb,Tb);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h), -Error("not implemented");}}c+=h}return c};var $b=N.B,ac={querySelector:function(a){return this.__shady_native_querySelector(a)},querySelectorAll:function(a){return this.__shady_native_querySelectorAll(a)}},bc={};function cc(a){bc[a]=function(b){return b["__shady_native_"+a]}}function dc(a,b){P(a,b,"__shady_native_");for(var c in b)cc(c)}function S(a,b){b=void 0===b?[]:b;for(var c=0;ce.assignedNodes.length&&(e.ra=!0)}e.ra&&(e.ra=!1,me(this,c))}c=this.a;b=[];for(e=0;eb.indexOf(d))||b.push(d);for(c=0;c "+h}))}return{value:a,Qa:b,stop:f}}function Yg(a,b){a=a.split(/(\[.+?\])/);for(var c=[],d=0;d+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,ah=/[[.:#*]/,Tg=/^(::slotted)/,$g=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Zg=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Wg=/(.*):dir\((?:(ltr|rtl))\)(.*)/,Rg=/:(?:matches|any|-(?:webkit|moz)-any)/,Gg=new Dg;function ch(a,b,c,d,e){this.H=a||null;this.b=b||null;this.ta=c||[];this.F=null;this.cssBuild=e||"";this.ba=d||"";this.a=this.G=this.L=null}function dh(a){return a?a.__styleInfo:null}function eh(a,b){return a.__styleInfo=b}ch.prototype.c=function(){return this.H};ch.prototype._getStyleRules=ch.prototype.c;function fh(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var gh=/:host\s*>\s*/,hh=navigator.userAgent.match("Trident");function ih(){}function jh(a){var b={},c=[],d=0;og(a,function(f){kh(f);f.index=d++;f=f.v.cssText;for(var g;g=ig.exec(f);){var h=g[1];":"!==g[2]&&(b[h]=!0)}},function(f){c.push(f)});a.b=c;a=[];for(var e in b)a.push(e);return a} -function kh(a){if(!a.v){var b={},c={};lh(a,c)&&(b.K=c,a.rules=null);b.cssText=a.parsedCssText.replace(lg,"").replace(fg,"");a.v=b}}function lh(a,b){var c=a.v;if(c){if(c.K)return Object.assign(b,c.K),!0}else{c=a.parsedCssText;for(var d;a=fg.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}} -function mh(a,b,c){b&&(b=0<=b.indexOf(";")?nh(a,b,c):wg(b,function(d,e,f,g){if(!e)return d+g;(e=mh(a,c[e],c))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=mh(a,c[f]||f,c)||f;return d+(e||"")+g}));return b&&b.trim()||""} -function nh(a,b,c){b=b.split(";");for(var d=0,e,f;d *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));if(g||h)c=e,h&&(b.w||(b.w=Ng(Gg,b,Gg.b,a?"."+a:"",e)),c=b.w||e),g&&"html"===e&&(c=b.w||b.J),d({wa:c,Xa:h,mb:g})}} -function qh(a,b,c){var d={},e={};og(b,function(f){ph(a,f,c,function(g){fh.call(a._element||a,g.wa)&&(g.Xa?lh(f,d):lh(f,e))})},null,!0);return{cb:e,Va:d}} -function rh(a,b,c,d){var e=zg(b),f=Mg(e.is,e.ba),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),h=dh(b);e=h.H;h=h.cssBuild;var k=sh(e,d);return Kg(b,e,function(l){var m="";l.v||kh(l);l.v.cssText&&(m=nh(a,l.v.cssText,c));l.cssText=m;if(!V&&!qg(l)&&l.cssText){var q=m=l.cssText;null==l.Da&&(l.Da=jg.test(m));if(l.Da)if(null==l.ja){l.ja=[];for(var H in k)q=k[H],q=q(m),m!==q&&(m=q,l.ja.push(H))}else{for(H=0;H=l._useCount&&l.parentNode&&l.parentNode.removeChild(l));V?k.a?(k.a.textContent=h,g=k.a):h&&(g=rg(h,f,a.shadowRoot,k.b)):g?g.parentNode||(hh&&-1F&&-1==[34,35,60,62,63,96].indexOf(F)?r:encodeURIComponent(r)}function d(r){var F=r.charCodeAt(0);return 32F&&-1==[34,35,60,62,96].indexOf(F)?r:encodeURIComponent(r)}function e(r,F,C){function M(ka){ta.push(ka)}var y=F||"scheme start",W=0,v="",sa=!1,ea=!1,ta=[];a:for(;(void 0!=r[W-1]||0==W)&&!this.h;){var n=r[W];switch(y){case "scheme start":if(n&&q.test(n))v+= -n.toLowerCase(),y="scheme";else if(F){M("Invalid scheme.");break a}else{v="";y="no scheme";continue}break;case "scheme":if(n&&H.test(n))v+=n.toLowerCase();else if(":"==n){this.g=v;v="";if(F)break a;void 0!==l[this.g]&&(this.A=!0);y="file"==this.g?"relative":this.A&&C&&C.g==this.g?"relative or authority":this.A?"authority first slash":"scheme data"}else if(F){void 0!=n&&M("Code point not allowed in scheme: "+n);break a}else{v="";W=0;y="no scheme";continue}break;case "scheme data":"?"==n?(this.o="?", -y="query"):"#"==n?(this.u="#",y="fragment"):void 0!=n&&"\t"!=n&&"\n"!=n&&"\r"!=n&&(this.pa+=c(n));break;case "no scheme":if(C&&void 0!==l[C.g]){y="relative";continue}else M("Missing scheme."),f.call(this),this.h=!0;break;case "relative or authority":if("/"==n&&"/"==r[W+1])y="authority ignore slashes";else{M("Expected /, got: "+n);y="relative";continue}break;case "relative":this.A=!0;"file"!=this.g&&(this.g=C.g);if(void 0==n){this.i=C.i;this.m=C.m;this.j=C.j.slice();this.o=C.o;this.s=C.s;this.f=C.f; -break a}else if("/"==n||"\\"==n)"\\"==n&&M("\\ is an invalid code point."),y="relative slash";else if("?"==n)this.i=C.i,this.m=C.m,this.j=C.j.slice(),this.o="?",this.s=C.s,this.f=C.f,y="query";else if("#"==n)this.i=C.i,this.m=C.m,this.j=C.j.slice(),this.o=C.o,this.u="#",this.s=C.s,this.f=C.f,y="fragment";else{y=r[W+1];var I=r[W+2];if("file"!=this.g||!q.test(n)||":"!=y&&"|"!=y||void 0!=I&&"/"!=I&&"\\"!=I&&"?"!=I&&"#"!=I)this.i=C.i,this.m=C.m,this.s=C.s,this.f=C.f,this.j=C.j.slice(),this.j.pop();y= -"relative path";continue}break;case "relative slash":if("/"==n||"\\"==n)"\\"==n&&M("\\ is an invalid code point."),y="file"==this.g?"file host":"authority ignore slashes";else{"file"!=this.g&&(this.i=C.i,this.m=C.m,this.s=C.s,this.f=C.f);y="relative path";continue}break;case "authority first slash":if("/"==n)y="authority second slash";else{M("Expected '/', got: "+n);y="authority ignore slashes";continue}break;case "authority second slash":y="authority ignore slashes";if("/"!=n){M("Expected '/', got: "+ -n);continue}break;case "authority ignore slashes":if("/"!=n&&"\\"!=n){y="authority";continue}else M("Expected authority, got: "+n);break;case "authority":if("@"==n){sa&&(M("@ already seen."),v+="%40");sa=!0;for(n=0;n {\n const prop = Object.getOwnPropertyDescriptor(obj, name);\n return prop && prop.enumerable;\n });\n};\n\n// implement iterators for IE 11\nconst iterator = window.Symbol.iterator;\n\nif (!String.prototype[iterator] || !String.prototype.codePointAt) {\n /** @this {String} */\n String.prototype[iterator] = function*() {\n for (let i = 0; i < this.length; i++) {\n yield this[i];\n }\n }\n}\n\nif (!Set.prototype[iterator]) {\n /** @this {Set} */\n Set.prototype[iterator] = function*() {\n const temp = [];\n this.forEach((value) => {\n temp.push(value);\n });\n for (let i = 0; i < temp.length; i++) {\n yield temp[i];\n }\n };\n}\n\nif (!Map.prototype[iterator]) {\n /** @this {Map} */\n Map.prototype[iterator] = function*() {\n const entries = [];\n this.forEach((value, key) => {\n entries.push([key, value]);\n });\n for(let i = 0; i < entries.length; i++) {\n yield entries[i];\n }\n };\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function() {\n 'use strict';\n\n // defaultPrevented is broken in IE.\n // https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called\n var workingDefaultPrevented = (function() {\n var e = document.createEvent('Event');\n e.initEvent('foo', true, true);\n e.preventDefault();\n return e.defaultPrevented;\n })();\n\n if (!workingDefaultPrevented) {\n var origPreventDefault = Event.prototype.preventDefault;\n Event.prototype.preventDefault = function() {\n if (!this.cancelable) {\n return;\n }\n\n origPreventDefault.call(this);\n\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n },\n configurable: true\n });\n };\n }\n\n var isIE = /Trident/.test(navigator.userAgent);\n\n // Event constructor shim\n if (!window.Event || isIE && (typeof window.Event !== 'function')) {\n var origEvent = window.Event;\n /**\n * @param {!string} inType\n * @param {?(EventInit)=} params\n */\n window.Event = function(inType, params) {\n params = params || {};\n var e = document.createEvent('Event');\n e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n return e;\n };\n if (origEvent) {\n for (var i in origEvent) {\n window.Event[i] = origEvent[i];\n }\n window.Event.prototype = origEvent.prototype;\n }\n }\n\n // CustomEvent constructor shim\n if (!window.CustomEvent || isIE && (typeof window.CustomEvent !== 'function')) {\n /**\n * @template T\n * @param {!string} inType\n * @param {?(CustomEventInit)=} params\n */\n window.CustomEvent = function(inType, params) {\n params = params || {};\n var e = document.createEvent('CustomEvent');\n e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);\n return e;\n };\n window.CustomEvent.prototype = window.Event.prototype;\n }\n\n if (!window.MouseEvent || isIE && (typeof window.MouseEvent !== 'function')) {\n var origMouseEvent = window.MouseEvent;\n /**\n *\n * @param {!string} inType\n * @param {?(MouseEventInit)=} params\n */\n window.MouseEvent = function(inType, params) {\n params = params || {};\n var e = document.createEvent('MouseEvent');\n e.initMouseEvent(inType,\n Boolean(params.bubbles), Boolean(params.cancelable),\n params.view || window, params.detail,\n params.screenX, params.screenY, params.clientX, params.clientY,\n params.ctrlKey, params.altKey, params.shiftKey, params.metaKey,\n params.button, params.relatedTarget);\n return e;\n };\n if (origMouseEvent) {\n for (var j in origMouseEvent) {\n window.MouseEvent[j] = origMouseEvent[j];\n }\n }\n window.MouseEvent.prototype = origMouseEvent.prototype;\n }\n})();","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n// minimal template polyfill\n(function() {\n 'use strict';\n\n var needsTemplate = (typeof HTMLTemplateElement === 'undefined');\n var brokenDocFragment = !(document.createDocumentFragment().cloneNode() instanceof DocumentFragment);\n var needsDocFrag = false;\n\n // NOTE: Replace DocumentFragment to work around IE11 bug that\n // causes children of a document fragment modified while\n // there is a mutation observer to not have a parentNode, or\n // have a broken parentNode (!?!)\n if (/Trident/.test(navigator.userAgent)) {\n (function() {\n\n needsDocFrag = true;\n\n var origCloneNode = Node.prototype.cloneNode;\n Node.prototype.cloneNode = function cloneNode(deep) {\n var newDom = origCloneNode.call(this, deep);\n if (this instanceof DocumentFragment) {\n newDom.__proto__ = DocumentFragment.prototype;\n }\n return newDom;\n };\n\n // IE's DocumentFragment querySelector code doesn't work when\n // called on an element instance\n DocumentFragment.prototype.querySelectorAll = HTMLElement.prototype.querySelectorAll;\n DocumentFragment.prototype.querySelector = HTMLElement.prototype.querySelector;\n\n Object.defineProperties(DocumentFragment.prototype, {\n 'nodeType': {\n get: function () {\n return Node.DOCUMENT_FRAGMENT_NODE;\n },\n configurable: true\n },\n\n 'localName': {\n get: function () {\n return undefined;\n },\n configurable: true\n },\n\n 'nodeName': {\n get: function () {\n return '#document-fragment';\n },\n configurable: true\n }\n });\n\n var origInsertBefore = Node.prototype.insertBefore;\n function insertBefore(newNode, refNode) {\n if (newNode instanceof DocumentFragment) {\n var child;\n while ((child = newNode.firstChild)) {\n origInsertBefore.call(this, child, refNode);\n }\n } else {\n origInsertBefore.call(this, newNode, refNode);\n }\n return newNode;\n }\n Node.prototype.insertBefore = insertBefore;\n\n var origAppendChild = Node.prototype.appendChild;\n Node.prototype.appendChild = function appendChild(child) {\n if (child instanceof DocumentFragment) {\n insertBefore.call(this, child, null);\n } else {\n origAppendChild.call(this, child);\n }\n return child;\n };\n\n var origRemoveChild = Node.prototype.removeChild;\n var origReplaceChild = Node.prototype.replaceChild;\n Node.prototype.replaceChild = function replaceChild(newChild, oldChild) {\n if (newChild instanceof DocumentFragment) {\n insertBefore.call(this, newChild, oldChild);\n origRemoveChild.call(this, oldChild);\n } else {\n origReplaceChild.call(this, newChild, oldChild);\n }\n return oldChild;\n };\n\n Document.prototype.createDocumentFragment = function createDocumentFragment() {\n var frag = this.createElement('df');\n frag.__proto__ = DocumentFragment.prototype;\n return frag;\n };\n\n var origImportNode = Document.prototype.importNode;\n Document.prototype.importNode = function importNode(impNode, deep) {\n deep = deep || false;\n var newNode = origImportNode.call(this, impNode, deep);\n if (impNode instanceof DocumentFragment) {\n newNode.__proto__ = DocumentFragment.prototype;\n }\n return newNode;\n };\n })();\n }\n\n // NOTE: we rely on this cloneNode not causing element upgrade.\n // This means this polyfill must load before the CE polyfill and\n // this would need to be re-worked if a browser supports native CE\n // but not