@@ -15,7 +15,7 @@ npm install --save-dev @web/rollup-plugin-html
15
15
If you have a single HTML page, you can set it as rollup input. This will be used by the HTML plugin as input for the plugin.
16
16
17
17
``` js
18
- import html from ' @web/rollup-plugin-html' ;
18
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
19
19
20
20
export default {
21
21
input: ' index.html' ,
@@ -29,7 +29,7 @@ export default {
29
29
If all pages share the same config, you can use a glob pattern to match multiple HTML files.
30
30
31
31
``` js
32
- import html from ' @web/rollup-plugin-html' ;
32
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
33
33
34
34
export default {
35
35
input: ' pages/*.html' ,
@@ -41,7 +41,7 @@ export default {
41
41
If your pages cannot be matched with a single glob you can set the input directly on HTML plugin.
42
42
43
43
``` js
44
- import html from ' @web/rollup-plugin-html' ;
44
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
45
45
46
46
export default {
47
47
output: { dir: ' dist' },
@@ -52,7 +52,7 @@ export default {
52
52
If each input should be bundled with a different config, you can create multiple instances of the HTML plugin.
53
53
54
54
``` js
55
- import html from ' @web/rollup-plugin-html' ;
55
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
56
56
57
57
export default {
58
58
output: { dir: ' dist' },
@@ -69,7 +69,7 @@ export default {
69
69
If your HTML file does not exist on disk, you can provide it as a string as well.
70
70
71
71
``` js
72
- import html from ' @web/rollup-plugin-html' ;
72
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
73
73
74
74
export default {
75
75
output: { dir: ' dist' },
@@ -88,7 +88,7 @@ export default {
88
88
This can also be set as an array:
89
89
90
90
``` js
91
- import html from ' @web/rollup-plugin-html' ;
91
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
92
92
93
93
export default {
94
94
output: { dir: ' dist' },
@@ -112,7 +112,7 @@ By default rollup will hash the asset filenames, enabling long term caching. You
112
112
To turn off bundling assets completely, set the ` extractAssets ` option to false:
113
113
114
114
``` js
115
- import html from ' @web/rollup-plugin-html' ;
115
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
116
116
117
117
export default {
118
118
input: ' index.html' ,
@@ -130,7 +130,7 @@ export default {
130
130
If your HTML file contains any absolute paths they will be resolved against the current working directory. You can set a different root directory in the config. Input paths will be resolved relative to this root directory as well.
131
131
132
132
``` js
133
- import html from ' @web/rollup-plugin-html' ;
133
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
134
134
135
135
export default {
136
136
input: ' index.html' ,
@@ -159,7 +159,7 @@ Will be output as:
159
159
- ` dist/pages/bar/page-c.html `
160
160
161
161
``` js
162
- import html from ' @web/rollup-plugin-html' ;
162
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
163
163
164
164
export default {
165
165
input: ' pages/**/*.html' ,
@@ -176,7 +176,7 @@ export default {
176
176
You can add transform functions to modify the HTML page and assets in the build, for example to inject scripts or minification.
177
177
178
178
``` js
179
- import html from ' @web/rollup-plugin-html' ;
179
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
180
180
181
181
export default {
182
182
input: ' index.html' ,
@@ -206,7 +206,7 @@ export default {
206
206
Set the minify option to do default HTML minificiation. If you need custom options, you can implement your own minifier using the ` transformHtml ` option.
207
207
208
208
``` js
209
- import html from ' @web/rollup-plugin-html' ;
209
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
210
210
211
211
export default {
212
212
input: ' index.html' ,
@@ -226,7 +226,7 @@ Some social media tags require full absolute URLs (e.g. https://domain.com/guide
226
226
By providing an ` absoluteBaseUrl ` the plugin can make sure all appropriate URLs are processed.
227
227
228
228
``` js
229
- import html from ' @web/rollup-plugin-html' ;
229
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
230
230
231
231
export default {
232
232
input: ' index.html' ,
@@ -261,7 +261,7 @@ In order to enable PWA support you can enable the injection of a service worker
261
261
Note: This does not create the service worker
262
262
263
263
``` js
264
- import html from ' @web/rollup-plugin-html' ;
264
+ import { rollupPluginHTML as html } from ' @web/rollup-plugin-html' ;
265
265
266
266
export default {
267
267
input: ' index.html' ,
0 commit comments