TheLarkInn / angular2-template-loader

Chain-to loader for webpack that inlines all html and style's in angular2 components.
MIT License
205 stars 70 forks source link

add webpack resolve root support #21

Open gitwuhao opened 8 years ago

gitwuhao commented 8 years ago
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 commented 8 years ago

Is this related to https://github.com/TheLarkInn/angular2-template-loader/issues/20?

TheLarkInn commented 8 years ago

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

jedwards1211 commented 6 years ago

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