Skip to content

Should config.resolve.modules be undefined when overriding backpack? #140

@gitleet

Description

@gitleet

I have a multi nodejs project setup like this:

project1
project2
shared
backpack.config.js
package.json

So I want to be able to reference the shared folder code from within my other projects.
To do this I have to add path ./ to the NODE_PATH when I run my project1 for example:

"scripts": {
    "dev:project1": "cross-env NODE_PATH=./ cross-env NODE_ENV=development cross-env 
    DIR=api backpack"
  }

So I need to add the value of NODE_PATH to my resolve modules in the backpack config:

config.resolve.modules.push(nodePath);

Should the config.resolve.modules be undefined at this point? (that is what I am seeing) so I am doing this instead:

  config.resolve.modules = [nodePath];

The reason I am confused is because this other project that uses backpack is a .push call https://github.com/withspectrum/spectrum/blob/alpha/backpack.config.js#L36

When I try the same thing I can see that the modules array is actually undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions