source: frontend/node_modules/workbox-webpack-plugin/src/lib/resolve-webpack-url.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 943 bytes
Line 
1/*
2 Copyright 2018 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8
9/**
10 * Resolves a url in the way that webpack would (with string concatenation)
11 *
12 * Use publicPath + filePath instead of url.resolve(publicPath, filePath) see:
13 * https://webpack.js.org/configuration/output/#output-publicpath
14 *
15 * @function resolveWebpackURL
16 * @param {string} publicPath The publicPath value from webpack's compilation.
17 * @param {Array<string>} paths File paths to join
18 * @return {string} Joined file path
19 *
20 * @private
21 */
22export function resolveWebpackURL(publicPath: string, ...paths: Array<string>): string {
23 // This is a change in webpack v5.
24 // See https://github.com/jantimon/html-webpack-plugin/pull/1516
25 if (publicPath === 'auto') {
26 return paths.join('');
27 } else {
28 return [publicPath, ...paths].join('');
29 }
30}
Note: See TracBrowser for help on using the repository browser.