rollup-prerender-plugin
Advanced tools
+7
-2
@@ -16,3 +16,4 @@ 'use strict'; | ||
| routes: ['/'], | ||
| hook: 'closeBundle', | ||
| hook: 'writeBundle', | ||
| removeScripts: false, | ||
| puppeteer: {}, | ||
@@ -37,3 +38,7 @@ ...userConfig, | ||
| const outputFile = path.join(routeOutputDir, './index.html'); | ||
| fs.writeFileSync(outputFile, renderedRoute.html.trim()); | ||
| let html = renderedRoute.html.trim(); | ||
| if (config.removeScripts) { | ||
| html = html.replace(/\<script.+\<\/script>/, ''); | ||
| } | ||
| fs.writeFileSync(outputFile, html); | ||
| } | ||
@@ -40,0 +45,0 @@ prerenderer.destroy(); |
+7
-2
@@ -9,3 +9,4 @@ import { join } from 'path'; | ||
| routes: ['/'], | ||
| hook: 'closeBundle', | ||
| hook: 'writeBundle', | ||
| removeScripts: false, | ||
| puppeteer: {}, | ||
@@ -30,3 +31,7 @@ ...userConfig, | ||
| const outputFile = join(routeOutputDir, './index.html'); | ||
| writeFileSync(outputFile, renderedRoute.html.trim()); | ||
| let html = renderedRoute.html.trim(); | ||
| if (config.removeScripts) { | ||
| html = html.replace(/\<script.+\<\/script>/, ''); | ||
| } | ||
| writeFileSync(outputFile, html); | ||
| } | ||
@@ -33,0 +38,0 @@ prerenderer.destroy(); |
+1
-1
| { | ||
| "name": "rollup-prerender-plugin", | ||
| "version": "0.0.5", | ||
| "version": "0.1.0", | ||
| "description": "A small Rollup plugin to prerender output.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+8
-0
@@ -49,2 +49,10 @@ # Rollup Prerender Plugin | ||
| ### `removeScripts` | ||
| Type: `Boolean` | ||
| Default: `false` | ||
| Remove all scripts tag from rendered html. | ||
| ### `puppeteer` | ||
@@ -51,0 +59,0 @@ |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5108
7.95%92
12.2%64
14.29%