Skip to content

Commit 904ae87

Browse files
committed
fix: update so certain PL assets are prefetched vs preloaded
1 parent 56fece6 commit 904ae87

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

packages/uikit-workshop/src/html/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<meta name="theme-color" content="#ababab" />
1111
<link rel="stylesheet" href="styleguide/css/pattern-lab.css" media="all" />
1212

13-
<link rel="preload" as="image" href="/images/bolt-logo--dark.svg">
14-
<link rel="preload" as="image" href="/images/bolt-logo--light.svg">
13+
<link rel="prefetch" as="image" href="/images/bolt-logo--dark.svg">
14+
<link rel="prefetch" as="image" href="/images/bolt-logo--light.svg">
1515
</head>
1616

1717
<body class="pl-c-body">

packages/uikit-workshop/src/scripts/patternlab-viewer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ import './components/pl-tools-menu/pl-tools-menu';
1414
import(
1515
/* webpackChunkName: "pl-viewport-sizes" */
1616
/* webpackMode: "lazy" */
17-
/* webpackPreload: true */
17+
/* webpackPrefetch: true */
1818
'./components/pl-viewport-size-list/pl-viewport-size-list');
1919

2020
import(
2121
/* webpackChunkName: "pl-search" */
2222
/* webpackMode: "lazy" */
23-
/* webpackPreload: true */
23+
/* webpackPrefetch: true */
2424
'./components/pl-search/pl-search');
2525

2626
import(
2727
/* webpackChunkName: "pl-modal-viewer" */
2828
/* webpackMode: "lazy" */
29-
/* webpackPreload: true */
29+
/* webpackPrefetch: true */
3030
'./components/modal-viewer');
3131

3232

packages/uikit-workshop/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ module.exports = async function() {
249249
staticDir: path.resolve(process.cwd(), `${config.buildDir}/`),
250250
// Required - Routes to render.
251251
routes: [ '/'],
252+
postProcess(context) {
253+
context.html = context.html.replace(/<script\s[^>]*charset=\"utf-8\"[^>]*><\/script>/gi, '');
254+
return context;
255+
}
252256
}),
253257
// clear out the buildDir on every fresh Webpack build
254258
new CleanWebpackPlugin(
@@ -270,7 +274,6 @@ module.exports = async function() {
270274
template: 'src/html/index.html',
271275
inject: false,
272276
}),
273-
new PreloadWebpackPlugin(),
274277
new MiniCssExtractPlugin({
275278
filename: `[name].css`,
276279
chunkFilename: `[id].css`,

0 commit comments

Comments
 (0)