9

This is my first attempt at trying to understand/use rollup.

I am using this boilerplate as it is all based around three.js which I also enjoy working with.

My current (almost certainly incorrect) method thus far has been:

  1. Download boilerplate project from github

  2. First I wanted to understand what parts of the project I would need to push to my website to get it working 'as is'. I did this succesfully and can see the project live on one of my websites subdomains.

  3. Now I tried setting up my production environment locally. I made a copy of the github download, and ran npm install - this introduced my node_modules folder and downloaded all dependencies. I installed rollup globally.

  4. Next I ran rollup watch - hoping it would consistently update my build file. This is when I got the error:

Error: Could not resolve entry module (watch).
        at error (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\rollup.js:213:30)
        at ModuleLoader.loadEntryModule (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\rollup.js:17642:16)
        at async Promise.all (index 0)

My config file looks like this:

import resolve from '@rollup/plugin-node-resolve'; // locate and bundle dependencies in node_modules (mandatory)
import { terser } from "rollup-plugin-terser"; // code minification (optional)

export default {
    input: 'src/main.js',
    output: [
        {
            format: 'umd',
            name: 'LIB',
            file: 'build/main.js'
        }
    ],
    plugins: [ resolve(), terser() ]
};

My file tree looks like this - this is just the same as the github download plus the new node_modules folder:

enter image description here

If anyone has any ideas or can point out something i'm misunderstanding it would be appreciated! If I didn't include something you think would be useful to help answer, let me know and I can update my question.

EDIT:

I tried using rollup -w & rollup --w which gave me this error:

[!] Error: You must supply options.input to rollup
Error: You must supply options.input to rollup
    at Graph.generateModuleGraph (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\rollup.js:18319:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Graph.build (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\rollup.js:18239:9)
    at async Object.rollupInternal (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\rollup.js:19100:18)
    at async Task.run (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\watch.js:715:28)
    at async Watcher.run (C:\Users\Shadow\AppData\Roaming\npm\node_modules\rollup\dist\shared\watch.js:640:17)
704
  • 287
  • 2
  • 3
  • 12

1 Answers1

1

I was potentially using the wrong wording. I cant confirm that because documentation seems thin. But i used rollup -c "rollup_config.js -w" and it now works.

704
  • 287
  • 2
  • 3
  • 12