diff --git a/src/defaultConfig.ts b/src/defaultConfig.ts index 3cf02ce7..bcf921dc 100644 --- a/src/defaultConfig.ts +++ b/src/defaultConfig.ts @@ -1,4 +1,4 @@ -import type { ModuleOptions } from './types' +import { ModuleOptions } from './types' const defaultThrowErrorValue = { throwError: true } @@ -81,7 +81,6 @@ export const defaultSecurityConfig = (serverlUrl: string): ModuleOptions => ({ exclude: [/node_modules/, /\.git/] }, ssg: { - hashScripts: true, - hashStyles: false + hashScripts: true } }) diff --git a/src/runtime/nitro/plugins/02-cspSsg.ts b/src/runtime/nitro/plugins/02-cspSsg.ts index 667da99a..cfa22c1c 100644 --- a/src/runtime/nitro/plugins/02-cspSsg.ts +++ b/src/runtime/nitro/plugins/02-cspSsg.ts @@ -85,7 +85,7 @@ export default defineNitroPlugin((nitroApp) => { // Remove '""' tagPolicies['script-src'] = (tagPolicies['script-src'] ?? []).concat(scriptHashes) } - if (styleHashes.length > 0 && moduleOptions.ssg?.hashStyles) { + if (styleHashes.length > 0 && moduleOptions.ssg?.hashScripts) { // Remove '""' tagPolicies['style-src'] = (tagPolicies['style-src'] ?? []).concat(styleHashes) } diff --git a/src/types/index.ts b/src/types/index.ts index a930f9fe..6be40128 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -6,7 +6,6 @@ import type { AllowedHTTPMethods, BasicAuth, CorsOptions, RateLimiter, RequestSi export type Ssg = { hashScripts?: boolean; - hashStyles?: boolean; }; export interface ModuleOptions {