script-ext-html-webpack-plugin
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -74,2 +74,4 @@ 'use strict'; | ||
scriptAttributes = scriptAttributes + ' type="module"'; | ||
} else { | ||
scriptAttributes = ' type="text/javascript"' + scriptAttributes; | ||
} | ||
@@ -76,0 +78,0 @@ return '<script src="' + scriptName + '"' + scriptAttributes + '></script>'; |
{ | ||
"name": "script-ext-html-webpack-plugin", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Enhances html-webpack-plugin functionality with async and defer attributes for script elements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,3 +13,3 @@ Script Extension for HTML Webpack Plugin | ||
- [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Attributes) attribute; | ||
- inlining (**experimental**). | ||
- inlining | ||
@@ -19,3 +19,3 @@ This is an extension plugin for the [webpack](http://webpack.github.io) plugin [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) - a plugin that simplifies the creation of HTML files to serve your webpack bundles. | ||
The raw [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) incorporates all | ||
webpack-generated javascipt as synchronous`<script>` elements in the generated html. This plugin allows you to add attributes to these elements or even to inline the code in the element (**experimental**). | ||
webpack-generated javascipt as synchronous`<script>` elements in the generated html. This plugin allows you to add attributes to these elements or even to inline the code in the element. | ||
@@ -31,2 +31,3 @@ Installation | ||
Basic Usage | ||
@@ -70,3 +71,3 @@ ----------- | ||
You must pass a hash of configuration options to the plugin to cause the addition of attributes: | ||
- `inline`: array of `String`'s and/or `RegExp`'s defining scripts that should be inlined in the html (default: `[]`)(**experimental**); | ||
- `inline`: array of `String`'s and/or `RegExp`'s defining scripts that should be inlined in the html (default: `[]`); | ||
- `sync`: array of `String`'s and/or `RegExp`'s defining script names that should have no attribute (default: `[]`); | ||
@@ -83,3 +84,3 @@ - `async`: array of `String`'s and/or `RegExp`'s defining script names that should have an `async` attribute (default: `[]`); | ||
1. if a script name matches a `RegEx` or `String` from the `inline` option, it will be inlined (**experimental**); | ||
1. if a script name matches a `RegEx` or `String` from the `inline` option, it will be inlined; | ||
@@ -160,6 +161,2 @@ 2. if a script name matches a `Regex` or `String` from the `sync` option, it will have no attribute, *unless* it matched condition 1; | ||
-------- | ||
Inlining javascript in `<script>` tags was introduced in v1.2.0 and is currently considered **experimental**. | ||
It has not been tested against complex use cases and feedback/issues would be much appreciated. | ||
Several notes and caveats apply: | ||
@@ -183,1 +180,18 @@ * This feature is for `<script>`'s only. If you wish to inline css please see the sister plugin | ||
* An alternative approach, based on jade templates is illustrated in the [HtmlWebpackPlugin inline example](https://github.com/ampedandwired/html-webpack-plugin/tree/master/examples/inline). | ||
Change History | ||
-------------- | ||
v1.3.x | ||
* added `type="text/javascript"` by default, in response to [Safari 9.1.1 bug](https://github.com/ampedandwired/html-webpack-plugin/issues/309) | ||
* removed experimental status of inline option | ||
v1.2.x | ||
* added inline option | ||
v1.1.x | ||
* added `type="module"` option | ||
v1.0.x | ||
* initial release |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13419
99
191