@enhance/arc-plugin-rollup
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@enhance/arc-plugin-rollup", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Use rollup.js to bundle pages for the browser in your Enhance project", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const { join } = require('path') | ||
const { readdir } = require('fs/promises') | ||
const { existsSync } = require('fs') | ||
const { rollup } = require('rollup') | ||
@@ -14,28 +15,30 @@ const resolve = require('@rollup/plugin-node-resolve') | ||
const files = await readdir(browserDir) | ||
files.forEach(async file => { | ||
const inFile = join( | ||
cwd, | ||
'app', | ||
'browser', | ||
file | ||
) | ||
if (existsSync(browserDir)) { | ||
const files = await readdir(browserDir) | ||
files.forEach(async file => { | ||
const inFile = join( | ||
cwd, | ||
'app', | ||
'browser', | ||
file | ||
) | ||
const outFile = join( | ||
cwd, | ||
inv.static?.folder || 'public', | ||
'pages', | ||
file | ||
) | ||
const outFile = join( | ||
cwd, | ||
inv.static?.folder || 'public', | ||
'pages', | ||
file | ||
) | ||
const bundle = await rollup({ | ||
input: inFile, | ||
plugins: [resolve()] | ||
}) | ||
const bundle = await rollup({ | ||
input: inFile, | ||
plugins: [resolve()] | ||
}) | ||
bundle.write({ | ||
file: outFile, | ||
format: 'es' | ||
bundle.write({ | ||
file: outFile, | ||
format: 'es' | ||
}) | ||
}) | ||
}) | ||
} | ||
} | ||
@@ -42,0 +45,0 @@ |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
13555
54
2