-
Notifications
You must be signed in to change notification settings - Fork 24
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
Global CSS cannot be imported from within node_modules. #6
Comments
See #5 |
Not quite understanding this. You are saying that the normal way, like
doesn't work, because it is importing a JS file that imports a Less file. And that I need to import ALL less files of the components used across the app in Seems I am in for a bit of work... :-) |
Can you share some more code? I'll take a look later |
Sure, I'll try to show the relevant pieces. The project is huge ;-) next.config.js:
Then there is a root
This setup has served us fine since Next 9.2 or so but since the Next team seems inclined to drop the ball on Less support I found your "let's mimic their Sass setup" approach interesting ;-) |
I'm not quite sure where it's coming from. Can you try converting @import "node_modules/antd/lib/style/themes/default.less"; into @import "~antd/lib/style/themes/default.less"; ?
If this still fails, try replicating the issue in the examples dir in a fork. |
Good catch @akornato ! build runs a bit longer with this....however it now fails at
even though I can see in the source line 51 has |
@JesperWe hmm not sure why, I no longer even have |
Yes, this plugin seems to always enable javascript but it somehow it is not working for me. |
I created a nextjs package Example: https://codesandbox.io/s/nextjs-example-react-md-editor-qjhn7?file=/pages/index.js // next.config.js
const removeImports = require("next-remove-imports")();
module.exports = removeImports({}); // pages/index.js
import Head from 'next/head'
import MDEditor from '@uiw/react-md-editor';
import "@uiw/react-md-editor/dist/markdown-editor.css";
import "@uiw/react-markdown-preview/dist/markdown.css";
export default function Home() {
return (
<div>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<MDEditor value="**Hello world!!!**" />
</div>
)
} |
Hi!
Thanks for trying to contibute to solving the Next 10 / Webpack 5 / Ant Design mess ;-)
I am trying you solution, but ending up with
This does not happen if I try to add the component to your example code.
I cannot quite figure what the difference is though.
Any tips?
The text was updated successfully, but these errors were encountered: