Skip to content

Commit

Permalink
feat: Remove type="text/javascript" from injected script tags
Browse files Browse the repository at this point in the history
See https://www.w3.org/TR/html5/scripting-1.html#attr-script-type “The default, which is used if the attribute is absent, is "text/javascript"”

BREAKING CHANGE: The mimetype information "text/javascript" is removed from all generated script
tags
  • Loading branch information
jantimon committed Jun 3, 2018
1 parent cc3bf49 commit b46bf67
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 62 deletions.
2 changes: 1 addition & 1 deletion examples/appcache/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script></body></html>
2 changes: 1 addition & 1 deletion examples/custom-template/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<body>
<h2>Partial</h2>
<img src="0714810ae3fb211173e2964249507195.png">
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/default/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<title>Webpack App</title>
</head>
<body>
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/favicon/dist/webpack-4/favicon.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<title>HtmlWebpackPlugin example</title>
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
<body>
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/html-loader/dist/webpack-4/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
<body>
<img src="0714810ae3fb211173e2964249507195.png">
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/html-loader/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
<body>
<img src="0714810ae3fb211173e2964249507195.png">
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/inline/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
background: snow;
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
}</style><script>/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
Expand Down
2 changes: 1 addition & 1 deletion examples/inline/template.jade
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ html
each cssFile in htmlWebpackPlugin.files.css
style !{compilation.assets[cssFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
each jsFile in htmlWebpackPlugin.files.js
script(type="text/javascript") !{compilation.assets[jsFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
script !{compilation.assets[jsFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()}
2 changes: 1 addition & 1 deletion examples/jade-loader/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1999-01-01T05:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script type="text/javascript" src="bundle.js"></script></body></html>
<!DOCTYPE html><html><head><title>Jade demo</title><link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head><body><div id="main"><!-- this partial is used for frontend and backend--><div class="time"> <b>Current time</b><p>1999-01-01T05:00:00.000Z</p></div><img src="0714810ae3fb211173e2964249507195.png"></div><script src="bundle.js"></script></body></html>
2 changes: 1 addition & 1 deletion examples/javascript-advanced/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<html><head><title>Webpack App</title><link href="styles.css" rel="stylesheet"></head><body>Hello World from backend - <h2>Partial</h2>
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script></body></html>
2 changes: 1 addition & 1 deletion examples/javascript/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<head><link href="styles.css" rel="stylesheet"></head>Hello World from backend2018-02-14T04:00:28.077Z<h2>Partial</h2>
<img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script>
<img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script>
2 changes: 1 addition & 1 deletion examples/sort-manually/dist/webpack-4/first-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<link href="styles.css" rel="stylesheet"></head>
<body>
<img src="0714810ae3fb211173e2964249507195.png">
<script type="text/javascript" src="a.js"></script><script type="text/javascript" src="b.js"></script><script type="text/javascript" src="c.js"></script></body>
<script src="a.js"></script><script src="b.js"></script><script src="c.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/sort-manually/dist/webpack-4/second-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<link href="styles.css" rel="stylesheet"></head>
<body>
<img src="0714810ae3fb211173e2964249507195.png">
<script type="text/javascript" src="a.js"></script><script type="text/javascript" src="b.js"></script><script type="text/javascript" src="d.js"></script></body>
<script src="a.js"></script><script src="b.js"></script><script src="d.js"></script></body>
</html>
2 changes: 1 addition & 1 deletion examples/template-parameters/dist/webpack-4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<title>bar</title>
</head>
<body>
<script type="text/javascript" src="bundle.js"></script></body>
<script src="bundle.js"></script></body>
</html>
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ class HtmlWebpackPlugin {
tagName: 'script',
voidTag: false,
attributes: {
type: 'text/javascript',
src: scriptPath
}
}));
Expand Down
Loading

0 comments on commit b46bf67

Please sign in to comment.