question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Snowpack and electron support

See original GitHub issue

Thank your for these easy to use bindings.

Currently we are evaluating switching from webpack to snowpack and the major blocker currently Is getting monaco-editor to work correctly. I’ve had success with using this module, but we can’t always rely on users being able to download monaco-editor from the CDN. Because of that I am trying to include the monaco-editor sources in some way and got it mostly working on development builds with a simple mount in snowpack.config.js

module.exports = {
  mount: {
    'node_modules/monaco-editor/': {static: true, resolve:false, url: '/monaco-editor'},
  },
  ...
}

and then using loader like this in our root component:

loader.config(
    {
       paths: {
         vs: "/monaco-editor/min/vs"
       }
     }
 )

This works fine but shows some errors in the console because it can’t find the min-maps.

I can’t get it to work with a production build, which is based on this configuration. I have tried using the ESM examples shown in this monaco-editor issue but could not get it to work either. Do you have any idea what might be needed? Any help would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
martonlangacommented, Feb 23, 2021

I could manage to make it work both in dev & production by mounting it like:

    '../external/monaco-editor/min/vs': { // downloaded & unzipped from monaco-editor website
      url: '/monaco-editor',
      static: true,
      resolve: false,
    },

and defining the path like:

loader.config({ paths: { vs: 'monaco-editor' } })

The source-maps still don’t work like this, so I just disabled source map warnings in the electron instance.

But importing the built-in languages (html, json, …) fails. It tries to import them from /vs/language and not /monaco-editor/language. Is there a way to define the paths for the languages @suren-atoyan?

0reactions
suren-atoyancommented, Mar 28, 2022

you also can try this approach

Read more comments on GitHub >

github_iconTop Results From Across the Web

karolis-sh/electron-snowpack
Use Snowpack and esbuild for Electron app development - GitHub ... Built-in support for .env files (just as @snowpack/plugin-dotenv ):.
Read more >
electron-snowpack
Effective Electron app development with Snowpack and esbuild. Latest version: 0.13.0, last published: 8 months ago.
Read more >
electron-snowpack - npm Package Health Analysis
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >
The Snowpack Plugin Catalog
Snowpack plugins allow for configuration-minimal tooling integration. ... The Snowpack Plugin Catalog. Customize Snowpack with optimized build plugins.
Read more >
Developers - Snowpack and electron support -
Snowpack and electron support ... Thank your for these easy to use bindings. Currently we are evaluating switching from webpack to snowpack and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found