From b46bf67ae4492a12b60c42c7d26831e480522b49 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Sat, 19 May 2018 19:12:16 +0200 Subject: [PATCH] feat: Remove type="text/javascript" from injected script tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- examples/appcache/dist/webpack-4/index.html | 2 +- .../custom-template/dist/webpack-4/index.html | 2 +- examples/default/dist/webpack-4/index.html | 2 +- examples/favicon/dist/webpack-4/favicon.html | 2 +- .../html-loader/dist/webpack-4/about.html | 2 +- .../html-loader/dist/webpack-4/index.html | 2 +- examples/inline/dist/webpack-4/index.html | 2 +- examples/inline/template.jade | 2 +- .../jade-loader/dist/webpack-4/index.html | 2 +- .../dist/webpack-4/index.html | 2 +- examples/javascript/dist/webpack-4/index.html | 2 +- .../dist/webpack-4/first-file.html | 2 +- .../dist/webpack-4/second-file.html | 2 +- .../dist/webpack-4/index.html | 2 +- index.js | 1 - spec/BasicSpec.js | 84 +++++++++---------- spec/fixtures/invalid.html | 2 +- spec/fixtures/legacy.html | 2 +- spec/fixtures/template.jade | 2 +- spec/fixtures/test.html | 2 +- spec/fixtures/webpackconfig.html | 2 +- 21 files changed, 61 insertions(+), 62 deletions(-) diff --git a/examples/appcache/dist/webpack-4/index.html b/examples/appcache/dist/webpack-4/index.html index 536e8a47..3a2aa9e5 100644 --- a/examples/appcache/dist/webpack-4/index.html +++ b/examples/appcache/dist/webpack-4/index.html @@ -1 +1 @@ -Example template \ No newline at end of file +Example template \ No newline at end of file diff --git a/examples/custom-template/dist/webpack-4/index.html b/examples/custom-template/dist/webpack-4/index.html index d68bf441..9a4b4918 100644 --- a/examples/custom-template/dist/webpack-4/index.html +++ b/examples/custom-template/dist/webpack-4/index.html @@ -8,5 +8,5 @@

Partial

- + diff --git a/examples/default/dist/webpack-4/index.html b/examples/default/dist/webpack-4/index.html index 866dfa44..8a7f3ef8 100644 --- a/examples/default/dist/webpack-4/index.html +++ b/examples/default/dist/webpack-4/index.html @@ -5,5 +5,5 @@ Webpack App - + \ No newline at end of file diff --git a/examples/favicon/dist/webpack-4/favicon.html b/examples/favicon/dist/webpack-4/favicon.html index dd7daeb2..7276322a 100644 --- a/examples/favicon/dist/webpack-4/favicon.html +++ b/examples/favicon/dist/webpack-4/favicon.html @@ -5,5 +5,5 @@ HtmlWebpackPlugin example - + \ No newline at end of file diff --git a/examples/html-loader/dist/webpack-4/about.html b/examples/html-loader/dist/webpack-4/about.html index 68c0cab2..5689f881 100644 --- a/examples/html-loader/dist/webpack-4/about.html +++ b/examples/html-loader/dist/webpack-4/about.html @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/examples/html-loader/dist/webpack-4/index.html b/examples/html-loader/dist/webpack-4/index.html index 68c0cab2..5689f881 100644 --- a/examples/html-loader/dist/webpack-4/index.html +++ b/examples/html-loader/dist/webpack-4/index.html @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/examples/inline/dist/webpack-4/index.html b/examples/inline/dist/webpack-4/index.html index b49fc66a..9d15ee9c 100644 --- a/examples/inline/dist/webpack-4/index.html +++ b/examples/inline/dist/webpack-4/index.html @@ -1,6 +1,6 @@ Jade demo \ No newline at end of file +Jade demo
Current time

1999-01-01T05:00:00.000Z

\ No newline at end of file diff --git a/examples/javascript-advanced/dist/webpack-4/index.html b/examples/javascript-advanced/dist/webpack-4/index.html index 61d6408d..194f6fba 100644 --- a/examples/javascript-advanced/dist/webpack-4/index.html +++ b/examples/javascript-advanced/dist/webpack-4/index.html @@ -1,2 +1,2 @@ Webpack AppHello World from backend -

Partial

- \ No newline at end of file + \ No newline at end of file diff --git a/examples/javascript/dist/webpack-4/index.html b/examples/javascript/dist/webpack-4/index.html index b0bcd096..2d600e19 100644 --- a/examples/javascript/dist/webpack-4/index.html +++ b/examples/javascript/dist/webpack-4/index.html @@ -1,2 +1,2 @@ Hello World from backend2018-02-14T04:00:28.077Z

Partial

- \ No newline at end of file + \ No newline at end of file diff --git a/examples/sort-manually/dist/webpack-4/first-file.html b/examples/sort-manually/dist/webpack-4/first-file.html index afacda4b..b2d63a4f 100644 --- a/examples/sort-manually/dist/webpack-4/first-file.html +++ b/examples/sort-manually/dist/webpack-4/first-file.html @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/examples/sort-manually/dist/webpack-4/second-file.html b/examples/sort-manually/dist/webpack-4/second-file.html index d6d80d35..1ef7520f 100644 --- a/examples/sort-manually/dist/webpack-4/second-file.html +++ b/examples/sort-manually/dist/webpack-4/second-file.html @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/examples/template-parameters/dist/webpack-4/index.html b/examples/template-parameters/dist/webpack-4/index.html index 397760f0..5d06507e 100644 --- a/examples/template-parameters/dist/webpack-4/index.html +++ b/examples/template-parameters/dist/webpack-4/index.html @@ -5,5 +5,5 @@ bar - + diff --git a/index.js b/index.js index f22134b5..465190ad 100644 --- a/index.js +++ b/index.js @@ -556,7 +556,6 @@ class HtmlWebpackPlugin { tagName: 'script', voidTag: false, attributes: { - type: 'text/javascript', src: scriptPath } })); diff --git a/spec/BasicSpec.js b/spec/BasicSpec.js index 708e4577..d8b6d964 100644 --- a/spec/BasicSpec.js +++ b/spec/BasicSpec.js @@ -166,7 +166,7 @@ describe('HtmlWebpackPlugin', function () { filename: 'index_bundle.js' }, plugins: [new HtmlWebpackPlugin()] - }, [/[\s]* + diff --git a/spec/fixtures/legacy.html b/spec/fixtures/legacy.html index 91cb1579..f7473d16 100644 --- a/spec/fixtures/legacy.html +++ b/spec/fixtures/legacy.html @@ -6,6 +6,6 @@

Some unique text

- + diff --git a/spec/fixtures/template.jade b/spec/fixtures/template.jade index 39aa1a97..5f56e942 100644 --- a/spec/fixtures/template.jade +++ b/spec/fixtures/template.jade @@ -6,4 +6,4 @@ html body p Some unique text each jsFile in htmlWebpackPlugin.files.js - script(type="text/javascript" src!=jsFile) + script(src!=jsFile) diff --git a/spec/fixtures/test.html b/spec/fixtures/test.html index fa8a9ec5..78d04850 100644 --- a/spec/fixtures/test.html +++ b/spec/fixtures/test.html @@ -6,6 +6,6 @@

Some unique text

- + diff --git a/spec/fixtures/webpackconfig.html b/spec/fixtures/webpackconfig.html index 3359eb7d..31d8cb67 100644 --- a/spec/fixtures/webpackconfig.html +++ b/spec/fixtures/webpackconfig.html @@ -6,6 +6,6 @@

Public path is <%= webpackConfig.output.publicPath %>

- +