Skip to content
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

Stopped working with html-loader v1.0.0 #85

Closed
cb-eli opened this issue Mar 25, 2020 · 5 comments
Closed

Stopped working with html-loader v1.0.0 #85

cb-eli opened this issue Mar 25, 2020 · 5 comments

Comments

@cb-eli
Copy link

cb-eli commented Mar 25, 2020

html-loader was updated to v1.0.0 with breaking changes. Since then ngtemplate-loader is breaking my build.

Everyone have the same issue?
Somebody have a fix for that?

@benochr
Copy link

benochr commented Mar 25, 2020

Same problem here.

It seems that the output of html-loader changed in v1.0.0.

In version 0.5.5 the output looked like this:
module.exports = "... html ...";

In version 1.1.0 the output has changed to:

// Module
var code = "... html ...";
// Exports
module.exports = code;

@benochr
Copy link

benochr commented Mar 25, 2020

Because of this change following code is no longer working as intended.

if (content.match(/^module\.exports/)) {
        var firstQuote = findQuote(content, false);
        var secondQuote = findQuote(content, true);
        html = content.substr(firstQuote, secondQuote - firstQuote + 1);
} else {
        html = content;
}

@peterpoe
Copy link

peterpoe commented Jul 5, 2020

Hey I have provided an alternative fix here #87 that adds compatibility with file-loader for stuff like <img src="..."> replacement

@cb-eli
Copy link
Author

cb-eli commented Jul 5, 2020

@WearyMonkey can you merge, please? :)

@WearyMonkey
Copy link
Owner

Sorry for the delay, I've released it now.

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

4 participants