Skip to content

Commit

Permalink
feat(bundling): add webpack chunk name
Browse files Browse the repository at this point in the history
Closes #1345 #1346

Co-Authored-By: CSchulz <cschulz@users.noreply.github.com>
  • Loading branch information
adamdbradley and CSchulz committed Jan 19, 2020
1 parent 3b513f2 commit 3ca7d82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/client/client-load-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const loadModule = (cmpMeta: d.ComponentRuntimeMeta, hostRef: d.HostRef,
/* webpackInclude: /\.entry\.js$/ */
/* webpackExclude: /\.system\.entry\.js$/ */
/* webpackMode: "lazy" */
/* webpackChunkName: "stencil-[request]" */
`./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`
).then(importedModule => {
if (!BUILD.hotModuleReplacement) {
Expand Down
4 changes: 2 additions & 2 deletions src/client/import-shims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const patchEsm = () => {
// @ts-ignore
if (BUILD.cssVarShim && !(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) {
// @ts-ignore
return import('./polyfills/css-shim.js').then(() => {
return import(/* webpackChunkName: "stencil-polyfills-css-shim" */ './polyfills/css-shim.js').then(() => {
plt.$cssShim$ = (win as any).__stencil_cssshim;
if (plt.$cssShim$) {
return plt.$cssShim$.initShim();
Expand Down Expand Up @@ -70,7 +70,7 @@ export const patchBrowser = (): Promise<d.CustomElementsDefineOptions> => {
if (!window.customElements) {
// module support, but no custom elements support (Old Edge)
// @ts-ignore
return import('./polyfills/dom.js').then(() => opts);
return import(/* webpackChunkName: "stencil-polyfills-dom" */ './polyfills/dom.js').then(() => opts);
}
}
return Promise.resolve(opts);
Expand Down
4 changes: 2 additions & 2 deletions src/client/polyfills/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function applyPolyfills() {
var win = window;

if (!win.customElements || (win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove))) {
promises.push(import('./dom.js'));
promises.push(import(/* webpackChunkName: "stencil-polyfills-dom" */ './dom.js'));
}

function checkIfURLIsSupported() {
Expand All @@ -26,7 +26,7 @@ export function applyPolyfills() {
!checkIfURLIsSupported() ||
typeof WeakMap == 'undefined'
) {
promises.push(import('./core-js.js'));
promises.push(import(/* webpackChunkName: "stencil-polyfills-core-js" */ './core-js.js'));
}
}
return Promise.all(promises);
Expand Down

0 comments on commit 3ca7d82

Please sign in to comment.