Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production build without SSR #4537

Closed
msteller-connyun opened this issue Mar 30, 2021 · 1 comment
Closed

Production build without SSR #4537

msteller-connyun opened this issue Mar 30, 2021 · 1 comment
Labels
closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests) feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@msteller-connyun
Copy link

msteller-connyun commented Mar 30, 2021

🚀 Feature

Allow production builds without SSR

Motivation

I’v some custom plugins/webpack-loaders which seems to require the window object.
Works fine in dev build, but fails to build for prod thanks to SSR.

I don’t need SSR, a normal SPA is good enough for my purpose.

<BrowserOnly/> is not resolving my issues.

Pitch

Add a new flag to build

build no-ssr.

@msteller-connyun msteller-connyun added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Mar 30, 2021
@slorber
Copy link
Collaborator

slorber commented Mar 30, 2021

I don't think it is something we want to support unless there are strong args and many people asking for this.

Docusaurus is focused on content-centric websites and SEO, SSR, Jamstack is important for such sites.

Why is your build failing? BrowserOnly may be not enough, you might also need a lazy require instead of a top-level ES import.

#4514

mac-s-g/react-json-view#121 (comment)

const BrowserOnlyReactJson = (props) => {
  return (
    <BrowserOnly>
      {() => {
        const ReactJson = require('react-json-view').default;
        return <ReactJson {...props} />;
      }}
    </BrowserOnly>
  );
};

@slorber slorber closed this as completed Mar 30, 2021
@Josh-Cena Josh-Cena added closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests) and removed status: needs triage This issue has not been triaged by maintainers labels Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests) feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

No branches or pull requests

3 participants