Closed bvklingeren closed 8 years ago
Found the solution for my problem. Typical RTFM case: normally browserify doesn't allow transforms on modules in node_modules
, except when you define in the module that transforms are to be done. See http://stackoverflow.com/questions/16110750/how-to-perform-a-transform-on-npm-module-using-browserify for the fix.
We are creating a shared Angular library as an NPM module containing angular directives with templates and it seems impossible to have those templates transformed in a separate Angular app with a dependency on that module. I get the same error as when we don't use browserify-ng-html2js (which enables the requiring of html templates):
Example with simplified HTML in the template. When I copy the directory with a single directive outside of
node_modules
and change therequire
to the path of that directive, the transformation works as designed. Is this bug or a feature? Or am I doing something wrong?Browserify command in gulpfile: