Skip to content

Commit 5c45482

Browse files
authored
fix: allow builds without the segment API key (#1716)
convert the error to a warning, to allow local development without the key
1 parent a8b2dbb commit 5c45482

File tree

1 file changed

+2
-3
lines changed
  • src/plugins/docusaurus-plugin-segment

1 file changed

+2
-3
lines changed

src/plugins/docusaurus-plugin-segment/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ module.exports = function (context, options) {
1616
}
1717

1818
if (!writeKey) {
19-
throw new Error(
20-
'You need to specify a Segment writeKey in the plugin options',
21-
);
19+
console.warn('You need to specify a Segment writeKey in the plugin options');
20+
return {};
2221
}
2322

2423
return {

0 commit comments

Comments
 (0)