No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Packaging with all dependencies/devDependencies removed from package.json - why does it work?

    Framework
    2
    4
    254
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      keechan last edited by keechan

      I am developing an Electron app using Quasar framework.

      Due to restrictions, my node_modules are static (not allowed to download anything online and have a fixed node_modules locally - just copy paste in new project if the need arises). I never run npm init.

      So in an attempt to minimize the bundled application size, I did an experiment and removed all dependencies and devDependencies from my package.json.

      • I ran the app and it still works.
      • But what surprised me is when I packaged the app, it still works. I do not get any errors stating that the required node_modules are missing.

      How come? Could this be of webpack, babel or something that has been bundled on the Quasar framework? Maybe the imported commands were compiled with the code and don’t need them to be included anymore as separate node_modules (ie in dist/electron/AppName/resources)?

      This is good news for me. But just wanted to understand why and if this will cause grave errors/crashes whatsoever.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • A
        AndrewE last edited by AndrewE

        The package.json is just for your package manager to know what to install in node-modules. If you are not managing packages, you don’t need the package manager. 😉
        Depending on your quasar.config settings, the actual bundle is mostly determined by treeshaking during your build - i.e., if your code asks for it, it is included in the build.

        K 1 Reply Last reply Reply Quote 0
        • K
          keechan last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • K
            keechan @AndrewE last edited by

            @AndrewE This clarifies it for me. Thanks so much! 🙂

            1 Reply Last reply Reply Quote 0
            • First post
              Last post