You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to install the module using root's package.json, and the extension app only manages the development code. However, it doesn't work unless you put package.json under extension.
With reference to the issue(#217) below, I succeeded in compiling the .tsx file by adding a custom plug-in in extension.config.js, but the style does not apply. Can you tell me what to do?
ERROR in ./content/styles.scss?inline_style 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> .content-script {
| position: fixed;
| z-index: 99999;
apps/extension/content/scripts.tsx
importReactDOMfrom'react-dom/client'import'./styles.scss?inline_style'if(document.readyState==='complete'){initial()}else{document.addEventListener('readystatechange',()=>{if(document.readyState==='complete')initial()})}functioninitial(){// Create a new div element and append it to the document's bodyconstrootDiv=document.createElement('div')rootDiv.id='extension-root'document.body.appendChild(rootDiv)// Injecting content_scripts inside a shadow dom// prevents conflicts with the host page's styles.// This way, styles from the extension won't leak into the host page.constshadowRoot=rootDiv.attachShadow({mode: 'open'})// Use the shadow root as the root element to inject styles into.window.__EXTENSION_SHADOW_ROOT__=shadowRootconstroot=ReactDOM.createRoot(shadowRoot)root.render(<divclassName="content-script"><h1>Hello from content script</h1></div>)}
Hi, I'm using Nx to configure monorepo with the structure below.
package.json is installing react, typescript, and sass.
I want to install the module using root's package.json, and the extension app only manages the development code. However, it doesn't work unless you put package.json under extension.
With reference to the issue(#217) below, I succeeded in compiling the .tsx file by adding a custom plug-in in extension.config.js, but the style does not apply. Can you tell me what to do?
The text was updated successfully, but these errors were encountered: