Skip to content

add webpack resolve root support #21

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

Open
gitwuhao opened this issue Aug 27, 2016 · 3 comments
Open

add webpack resolve root support #21

gitwuhao opened this issue Aug 27, 2016 · 3 comments

Comments

@gitwuhao
Copy link

gitwuhao commented Aug 27, 2016

function replaceStringsWithRequires(string) {
  return string.replace(stringRegex, function (match, quote, url) {
    /* add webpack resolve root support
    if (url.charAt(0) === "/") {
      url = url.substring(1);
    }else */if (url.charAt(0) !== ".") {
      url = "./" + url;
    }
    return "require('" + url + "')";
  });
}
@TheLarkInn
Copy link
Owner

Is this related to #20?

@TheLarkInn
Copy link
Owner

Resolve root will be deprecated for v2 instead the modules.root property. I would take a pr as an option.

@jedwards1211
Copy link

@TheLarkInn are you referring to modules.root property in package.json files or in the webpack config?

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

3 participants