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

Is it possible to ignore css module expression like import "//cdn.com/external.css" for SSR? #507

Open
ahuigo opened this issue Sep 9, 2022 · 2 comments

Comments

@ahuigo
Copy link

ahuigo commented Sep 9, 2022

What I mean is that, is it possible to skip this import "cdn/external.css" expression at hydrate server side?

Since this expression can only be used at browser side.

image

@ahuigo ahuigo changed the title Is it possible to support import "./external.css" expression? Is it possible to ignore import "./external.css" expression for SSR? Sep 9, 2022
@ahuigo ahuigo changed the title Is it possible to ignore import "./external.css" expression for SSR? Is it possible to ignore css module expression like import "//cdn.com/external.css" for SSR? Sep 9, 2022
@ddosakura
Copy link
Contributor

try <link /> in <Head />:

import { Head } from "aleph/react";
export default function Index() {
  // ...
  return (
    <div>
      <Head>
        <title>Monaco Editor</title>
        <link
          rel="stylesheet"
          href="https://esm.sh/v78/[email protected]/esnext/monaco-editor.css"
        />
      </Head>
      <div ref={editorRef}>
        <span style={{ color: "darkgray" }}>loading...</span>
      </div>
    </div>
  );
}

@ahuigo
Copy link
Author

ahuigo commented Sep 16, 2022

@ddosakura It's not a good way for external package.
Maybe, we should wait Deno to support it.
denoland/deno#11961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants