mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 22:18:44 +02:00
refactor: fix a lot of errors in type-aware linting (#7477)
This commit is contained in:
parent
222bf3c091
commit
bf1513a3e3
120 changed files with 407 additions and 364 deletions
|
@ -89,7 +89,7 @@ export default function pluginPWA(
|
|||
new webpack.EnvironmentPlugin({
|
||||
PWA_DEBUG: debug,
|
||||
PWA_SERVICE_WORKER_URL: path.posix.resolve(
|
||||
`${config.output?.publicPath || '/'}`,
|
||||
`${(config.output?.publicPath as string) || '/'}`,
|
||||
'sw.js',
|
||||
),
|
||||
PWA_OFFLINE_MODE_ACTIVATION_STRATEGIES:
|
||||
|
@ -102,7 +102,7 @@ export default function pluginPWA(
|
|||
|
||||
injectHtmlTags() {
|
||||
const headTags: HtmlTags = [];
|
||||
if (isProd && pwaHead) {
|
||||
if (isProd) {
|
||||
pwaHead.forEach(({tagName, ...attributes}) => {
|
||||
(['href', 'content'] as const).forEach((attribute) => {
|
||||
const attributeValue = attributes[attribute];
|
||||
|
@ -160,7 +160,7 @@ export default function pluginPWA(
|
|||
plugins: [
|
||||
new webpack.EnvironmentPlugin({
|
||||
// Fallback value required with Webpack 5
|
||||
PWA_SW_CUSTOM: swCustom || '',
|
||||
PWA_SW_CUSTOM: swCustom ?? '',
|
||||
}),
|
||||
new LogPlugin({
|
||||
name: 'Service Worker',
|
||||
|
@ -189,7 +189,7 @@ export default function pluginPWA(
|
|||
'**/*.{png,jpg,jpeg,gif,svg,ico}',
|
||||
'**/*.{woff,woff2,eot,ttf,otf}',
|
||||
// @ts-expect-error: internal API?
|
||||
...(injectManifest.globPatterns ?? []),
|
||||
...((injectManifest.globPatterns as string[] | undefined) ?? []),
|
||||
],
|
||||
// Those attributes are not overrideable
|
||||
swDest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue