@rollup-extras/plugin-html 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ Points:
|
|
|
6
6
|
|
|
7
7
|
- Inject file names with hashes
|
|
8
8
|
- Watch on a template file and trigger rebuild if it is changed
|
|
9
|
-
- Provides minimalistic template by default, so you are ready to start without configuration
|
|
9
|
+
- Provides a minimalistic template by default, so you are ready to start without configuration
|
|
10
10
|
- Supports multiple rollup configs (will trigger only when last output generated)
|
|
11
|
-
- Extensible through API so you can plug in something for
|
|
11
|
+
- Extensible through API so you can plug in something for HTML processing or generate new types of HTML elements
|
|
12
12
|
|
|
13
|
-
Uses [`@niceties/logger`](https://github.com/kshutkin/niceties/blob/main/logger/README.md) to log messages, can be configured through `@niceties/logger` API.
|
|
13
|
+
Uses [`@niceties/logger`](https://github.com/kshutkin/niceties/blob/main/logger/README.md) to log messages, which can be configured through `@niceties/logger` API.
|
|
14
14
|
|
|
15
15
|
[Changelog](./CHANGELOG.md)
|
|
16
16
|
|
|
@@ -40,13 +40,13 @@ export default {
|
|
|
40
40
|
|
|
41
41
|
## Providing options
|
|
42
42
|
|
|
43
|
-
Just pass options to the plugin function.
|
|
43
|
+
Just pass options to the plugin function. The returned object is the plugin instance which can be passed to rollup.
|
|
44
44
|
|
|
45
45
|
```javascript
|
|
46
46
|
html({option: value, option2: value2})
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
For additional plugin instances (in case of multiple configs) please use
|
|
49
|
+
For additional plugin instances (in case of multiple configs) please use `firstInstance.api.addInstance()`
|
|
50
50
|
|
|
51
51
|
## Options
|
|
52
52
|
|
|
@@ -60,7 +60,7 @@ For debugging purposes, so many instances of a plugin can be differentiated in d
|
|
|
60
60
|
|
|
61
61
|
Optional, string, default: `'index.html'`.
|
|
62
62
|
|
|
63
|
-
Used to override output file name. If a filename with the same name exists in the pipeline it will be removed or overwritten in the process but its content by default will be used as
|
|
63
|
+
Used to override output file name. If a filename with the same name exists in the pipeline it will be removed or overwritten in the process but its content by default will be used as input for this plugin. In the following example file emitted by copy plugin will be used as input for this plugin:
|
|
64
64
|
|
|
65
65
|
```javascript
|
|
66
66
|
import copy from '@rollup-extras/plugin-copy';
|
|
@@ -94,19 +94,19 @@ If the plugin found a template file name this option defines if the plugin needs
|
|
|
94
94
|
|
|
95
95
|
Optional, boolean, default: true.
|
|
96
96
|
|
|
97
|
-
Defines if the plugin should use this.emitFile or should just write it to disk.
|
|
97
|
+
Defines if the plugin should use this.emitFile or should just write it to disk. The option can be ignored in setup with multiple rollup configs.
|
|
98
98
|
|
|
99
99
|
### useEmittedTemplate
|
|
100
100
|
|
|
101
101
|
Optional, boolean, default: true.
|
|
102
102
|
|
|
103
|
-
Defines what the plugin does if it finds a file with the expected file name in the bundle. By default it will be used as a template. Templates provided through the template option should be of higher priority to the plugin.
|
|
103
|
+
Defines what the plugin does if it finds a file with the expected file name in the bundle. By default, it will be used as a template. Templates provided through the template option should be of higher priority to the plugin.
|
|
104
104
|
|
|
105
105
|
### conditionalLoading
|
|
106
106
|
|
|
107
107
|
Optional, boolean, default: undefined.
|
|
108
108
|
|
|
109
|
-
Defines if plugin adds `nomodule`
|
|
109
|
+
Defines if the plugin adds `nomodule` attributes for non-modular js chunks. By default, it is done only if we have an `es` output in one of the bundles processed by the plugin. Also plugin values `iife` outputs higher than `umd` and if we have both filters out `umd` ones. This can be changed only by providing a custom `assetFactory`.
|
|
110
110
|
|
|
111
111
|
### injectIntoHead
|
|
112
112
|
|
|
@@ -216,7 +216,7 @@ Creates a simple module script element.
|
|
|
216
216
|
|
|
217
217
|
`(...factories: AssetFactory[]) => AssetFactory`
|
|
218
218
|
|
|
219
|
-
Combines several factories, calls them in order, the first factory
|
|
219
|
+
Combines several factories, and calls them in order, the first factory-created asset wins.
|
|
220
220
|
|
|
221
221
|
## Configuration
|
|
222
222
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.4.
|
|
2
|
+
"version": "1.4.2",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@rollup-extras/plugin-html",
|
|
5
5
|
"author": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@niceties/logger": "^1.1.4",
|
|
56
|
-
"@rollup-extras/utils": "^1.4.
|
|
56
|
+
"@rollup-extras/utils": "^1.4.2"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "pkgbld-internal",
|