File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ export async function resolveConfig(
226226 userConfigMetadata : userConfigMetadata ?? { } ,
227227 alias,
228228 experimental : defu ( mergedConfig . experimental , { } ) ,
229+ suppressWarnings : mergedConfig . suppressWarnings ?? { } ,
229230 dev : {
230231 server : devServerConfig ,
231232 reloadCommand,
Original file line number Diff line number Diff line change @@ -121,11 +121,14 @@ export async function generateManifest(
121121 // Warn if building for Firefox without data_collection_permissions
122122 if (
123123 wxt . config . browser === 'firefox' &&
124- ! userManifest . browser_specific_settings ?. gecko ?. data_collection_permissions
124+ ! userManifest . browser_specific_settings ?. gecko
125+ ?. data_collection_permissions &&
126+ ! wxt . config . suppressWarnings ?. firefoxDataCollection
125127 ) {
126128 wxt . logger . warn (
127- 'Firefox requires explicit data collection permissions. Consider adding `data_collection_permissions` to your manifest config.\n' +
128- 'For more details, see: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/\n' ,
129+ 'Firefox requires `data_collection_permissions` for new extensions from November 3, 2025. Existing extensions are exempt for now.\n' +
130+ 'For more details, see: https://extensionworkshop.com/documentation/develop/firefox-builtin-data-consent/\n' +
131+ 'To suppress this warning, add `firefoxDataCollection: true` to `suppressWarnings` in your wxt config.\n' ,
129132 ) ;
130133 }
131134
Original file line number Diff line number Diff line change @@ -305,6 +305,7 @@ export const fakeResolvedConfig = fakeObjectCreator<ResolvedConfig>(() => {
305305 hooks : { } ,
306306 vite : ( ) => ( { } ) ,
307307 plugins : [ ] ,
308+ suppressWarnings : { } ,
308309 } ;
309310} ) ;
310311
Original file line number Diff line number Diff line change @@ -131,6 +131,22 @@ export interface InlineConfig {
131131 * object or promise.
132132 */
133133 manifest ?: UserManifest | Promise < UserManifest > | UserManifestFn ;
134+ /**
135+ * Suppress specific warnings during the build process.
136+ *
137+ * @example
138+ * ```ts
139+ * export default defineConfig({
140+ * suppressWarnings: {
141+ * firefoxDataCollection: true,
142+ * },
143+ * })
144+ * ```
145+ */
146+ suppressWarnings ?: { firefoxDataCollection ?: boolean } & Record <
147+ string ,
148+ boolean
149+ > ;
134150 /**
135151 * Configure browser startup. Options set here can be overridden in a `web-ext.config.ts` file.
136152 */
@@ -1393,6 +1409,13 @@ export interface ResolvedConfig {
13931409 */
13941410 alias : Record < string , string > ;
13951411 experimental : { } ;
1412+ /**
1413+ * List of warning identifiers to suppress during the build process.
1414+ */
1415+ suppressWarnings : { firefoxDataCollection ?: boolean } & Record <
1416+ string ,
1417+ boolean
1418+ > ;
13961419 dev : {
13971420 /** Only defined during dev command */
13981421 server ?: {
You can’t perform that action at this time.
0 commit comments