-
-
Notifications
You must be signed in to change notification settings - Fork 316
Fix refractor imports, migrate to webpack 5, update deps #621
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
Fix refractor imports, migrate to webpack 5, update deps #621
Conversation
|
tested within my vitejs (rolldown-vite) based application. Works for me, no errors in browser console or in the application any more. The relevant code in my app is: Some dependencies in my app's package.json: To integrate the pull request in my app I used this commands: |
|
Also, if package cloned locally, you can use npm link. |
|
Since npm link requires sudo privileges on macOS, I used the "npm install --no-save" variant instead. It's easier for a one-time test. |
|
Added to PR description instructions how package can be installed directly from github (for npm). Checked on webpack 5 based project which uses |
|
This also works for my React project now that uses Vite 6.4.1. In addition, I'm using the dev dependency "@types/react-syntax-highlighter": "^15.5.13". The code I'm using this library in my component is as follows: import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
export const MyComponent = () => {
...
return (
<SyntaxHighlighter
PreTag='div'
language={match[1]}
style={vscDarkPlus}
className={'text-content-codeblock-inner'}
{...props}>
{children}
</SyntaxHighlighter>
);
}; |
|
The fix works on my project as well which uses rsbuild: import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { oneLight, oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
export const MyComponent = () => {
...
return (
<SyntaxHighlighter
language={language}
style={isDark ? oneDark : oneLight}
/>
);
}; |
|
This fixes the errors in one of my projects that got broken after the update to |
|
Tried this in our vite 6 project and it fixes the build issue! |
|
Thank you so much @UncleJart and everyone for testing. I'll get this out shortly as |
List of changes:
lint-stagedto latest Node 16 compatible versioncross-envso npm scripts with env vars definitions don't fail on WindowstransformIgnorePatterns. All tests passed.enginessection topackage.jsonwith Node 16.20.2 requirementpackage.jsonwere checked to run properly on Win 11 with Node 16.20.2NODE_ENVwithDefinePlugin- its OK for webpack 5 and can be ignoredBriefly checked default Vite + React template with examples from react-syntax-highlighter Readme, seems like everything works OK - dev/prod build passed. Would be great if someone else checks it, also with webpack based project.
How to check (npm):
package.jsonreplace react-syntax-highlighter with the following versionnpm i