Skip to content

Conversation

@Daniel-Khodabakhsh
Copy link
Contributor

@Daniel-Khodabakhsh Daniel-Khodabakhsh commented May 6, 2018

Summary

Add tag if it doesn't exist. Feature request in #12

Requirements

Copy link
Contributor

@AnujRNair AnujRNair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! 2 small changes requested :)

);
});

it('adds meta tag when no template is specified', done => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adds meta tag with completed policy when the entire meta tag is missing?

plugins: [
new HtmlWebpackPlugin({
filename: path.join(OUTPUT_DIR, 'index.html'),
inject: 'body'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to create a new template with-no-meta-tag.html and explicitly set it here, using the template param? Example above :)

That way, if other examples change, this one won't start failing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I'll add a with-no-meta-tag.html test case.

Wouldn't you still want this original test case in addition to what you requested? This test case specifies no template at all, using the automatically generated template from HtmlWebpackPlugin. How would it start failing if other examples changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No template defaults to an index.html file, so if your changes are able to add the missing meta tag to the specified template here, it should add it to the one with no template too!

I was initially thinking that if HTML Webpack Plugin changed something (like started requiring a template), then this example may start failing

Copy link
Contributor

@AnujRNair AnujRNair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for the addition!

@AnujRNair AnujRNair merged commit aa2a8e8 into slackhq:master May 8, 2018
@AnujRNair AnujRNair mentioned this pull request May 8, 2018
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants