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

importing external js modules #132

Closed
blurymind opened this issue Dec 30, 2018 · 3 comments
Closed

importing external js modules #132

blurymind opened this issue Dec 30, 2018 · 3 comments

Comments

@blurymind
Copy link

Is it possible to require or import library js files? If so, how?

@shalithasuranga
Copy link
Member

Yes. you can use any client side js libraries with Neutralino. Place your js source files to app/assets and import to html
eg:-

<script src="/assets/app.js"></script>

But since there is no node runtime, node packages with require cannot be used.

@Vampire-Offical
Copy link

Is there any way to use node modules in neutralinojs ;

@pegvin
Copy link
Contributor

pegvin commented Jul 11, 2022

you need to understand how this works, modules in node_modules folder are useless for NeutralinoJs or Any other browsers because nodejs knows how to resolve those modules, but the browser doesn't know it.

For Example assume you have a module xyz installed and it's in the node_modules folder, when you require('xyz') nodejs uses it's module resolution algorithm to find that module in the node_modules folder but browsers or neutralinojs or even electron isn't built that way, they don't know where the module xyz is.

So For this purpose we use module bundlers, the main work of a module bundler is take a javascript file, resolve all the modules and put them in that file (also known as a bundle).

These Are Some Videos I'd Recommend You Watch:

Sadaf-A pushed a commit to Sadaf-A/neutralinojs that referenced this issue Mar 28, 2024
Bumps [tar](https://github.com/npm/node-tar) from 6.1.5 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.5...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

4 participants