Gathering detailed insights and metrics for rollup-plugin-smart-asset-lennard
Gathering detailed insights and metrics for rollup-plugin-smart-asset-lennard
npm install rollup-plugin-smart-asset-lennard
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
446
Last Day
1
Last Week
1
Last Month
6
Last Year
54
34 Stars
52 Commits
12 Forks
1 Watching
10 Branches
4 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.4
Package Id
rollup-plugin-smart-asset-lennard@1.1.4
Unpacked Size
42.34 kB
Size
9.26 kB
File Count
12
NPM Version
6.9.0
Node Version
12.3.1
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
50%
6
Compared to previous month
Last year
-33.3%
54
Compared to previous year
4
1
Rollup plugin to rebase, inline or copy assets referenced from the JavaScript code.
1import smartAsset from 'rollup-plugin-smart-asset' 2 3const smartAssetOpts = { ... } 4 5export default { 6 input: 'src/index.tsx', 7 output: { 8 file: 'dist/index.js', 9 format: 'iife' 10 }, 11 plugins: [ 12 ... 13 smartAsset(smartAssetOpts) 14 ... 15 ] 16}
For libraries it is recommended to use inline
or copy
mode with keepImport
option to delegate bundling to consumer's package bundler. Asset hasing is not
needed for this case and it is safe to set useHash: false
and keepName: true
.
For applications it is also recommended to use inline
or copy
mode with
enabled by default hashing.
Default settings are set to be the same as in postcss-smart-asset
to have one
config for both of them.
Main options:
url
: Mode: rebase
(default), inline
and copy
extensions
: What file extensions to process, defaults to
[".svg", ".gif", ".png", ".jpg"]
Rebase asset references to be relative to specific directory.
Output:
1// without keepImport 2export default "public_path_to_asset" 3// with keepImport 4export default require("relative_path_to_asset_from_bundle")
Options:
publicPath
: Reference file from JS using this path, relative to html page
where asset is referenced. Could be relative, absolute or CDN.rebasePath
: Rebase all asset urls to this directory, defaults to current directory.keepImport
: Keep import, so consumer of your package could define their own
bundle configuration.sourceMap
: Set to true
to keep source map.Inline assets as base64 urls directly in source code.
Keep in mind, all options for copy
mode will be used if falled back to copy
mode.
Output:
1export default "data:{mimeType};base64,{data}"
Options:
maxSize
: Max file size to inline, fallback is copy
mode, defaults to 14
kbytes.Copy asset to target directory and rebase original references to point to it depending on provided configuration.
Output:
1// without keepImport 2export default "public_path_to_asset" 3// with keepImport 4export default require("relative_path_to_asset_from_bundle") 5// + file is copied to target directory
Options:
publicPath
: Reference file from JS using this path, relative to html page
where asset is referenced. Could be relative, absolute or CDN.assetsPath
: Copy assets to this directory, relative to rollup output.useHash
: Use [hash][ext]
instead of default [name][ext]
keepName
: Use both hash and name [name]-[hash][ext]
if useHash
is true
nameFormat
: Use custom name format using these patterns [name]
, [ext]
,
[hash]
.hashOptions
: See more: https://github.com/sebastian-software/asset-hash
hash
: Any valid hashing algorithm e.g. metrohash128
(default), metrohash64
,
xxhash64
, xxhash32
, sha1
, md5
, ...encoding
: Any valid encoding for built-in digests hex
, base64
, base62
(default), ...maxLength
: Maximum length of returned digest. Keep in mind that reducing it
increases collison probability.keepImport
: Keep import, so consumer of your package could define their own
bundle configuration.https://github.com/rollup/rollup-plugin-url
rollup-plugin-url
has fewer options, doesn't work if asset is already loaded
by another plugin (by sourcemaps, for example) and, what is most important, has
non permissive license (as of 2018-03-02). This plugin has also keepImport
feature that is not available in rollup-plugin-url
.
https://github.com/sebastian-software/postcss-smart-asset
postcss-smart-asset
works well when you need to bundle assets referenced from
CSS, but doesn't work for assets imported from JavaScript.
https://github.com/sebastian-software/rollup-plugin-rebase
rollup-plugin-rebase
designed for libraries, not applications. This plugin
designed for all use cases.
postcss-smart-asset
and rollup-plugin-url
PRs are very welcome!
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 3/22 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
24 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More