Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
What is the proper way of bundling in node dependencies with rollup?

So I was trying to bundle in a bunch of external package dependencies using roll-up, like three JS and deck.gl. Right now I have a rollup config file set up like so, one to build just the code I have written and another that bundles in all the dependencies :

import externals from "rollup-plugin-node-externals";

export default [
  {
    input: "./Src/index.js",
    output: [
      {
        file: "./Build/pgl.js",
        format: "iife",
        plugins: [
          externals({
            deps: true, // Dependencies will not be bundled in
          }),
        ],
      },
      {
        file: "./Build/pgl_module.js",
        format: "iife",
        plugins: [
          externals({
            deps: false, // Dependencies will be bundled in
          }),
        ],
        sourceMap: true,
      },
    ],
  },
];

I have also tried to do the same thing with something like

import { nodeResolve } from '@rollup/plugin-node-resolve';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [nodeResolve()]
};

but to no avail it never bundles up the node packages into the build file and always gives the error :

...
three/examples/jsm/lines/Line2.js (guessing 'Line2_js')
three/examples/jsm/lines/LineMaterial.js (guessing 'LineMaterial_js')
three/examples/jsm/lines/LineGeometry.js (guessing 'LineGeometry_js')
three/examples/jsm/controls/OrbitControls (guessing 'OrbitControls')
@deck.gl/core (guessing 'core')
@deck.gl/layers (guessing 'layers')
(!) Unresolved dependencies
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!