Skip to content

Commit 21b41c4

Browse files
authored
fix: fix client side rendering of openapi docs (#1593)
Also disables the new validation for missing segment token on local.
1 parent fd45ee7 commit 21b41c4

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ module.exports = {
249249
module: {
250250
rules: [
251251
{
252-
test: /examples\//i,
252+
test: /\/examples\//i,
253253
type: 'asset/source',
254254
},
255255
],

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ module.exports = function (context, options) {
1111
},
1212

1313
injectHtmlTags() {
14+
if (process.env.NODE_ENV !== 'production' && !allowedInDev) {
15+
return {};
16+
}
17+
1418
if (!writeKey) {
1519
throw new Error(
1620
'You need to specify a Segment writeKey in the plugin options',
1721
);
1822
}
1923

20-
if (process.env.NODE_ENV !== 'production' && !allowedInDev) {
21-
return {};
22-
}
23-
2424
return {
2525
headTags: [
2626
{

0 commit comments

Comments
 (0)