New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@web/rollup-plugin-import-meta-assets

Package Overview
Dependencies
Maintainers
7
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/rollup-plugin-import-meta-assets - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

index.mjs

6

CHANGELOG.md
# @web/rollup-plugin-import-meta-assets
## 1.0.1
### Patch Changes
- fd9fe56: publish files
## 1.0.0

@@ -4,0 +10,0 @@

8

package.json
{
"name": "@web/rollup-plugin-import-meta-assets",
"version": "1.0.0",
"version": "1.0.1",
"publishConfig": {

@@ -26,3 +26,7 @@ "access": "public"

},
"files": ["dist"],
"files": [
"*.js",
"*.mjs",
"src"
],
"keywords": [

@@ -29,0 +33,0 @@ "rollup",

# Rollup Plugin import-meta-assets
Rollup plugin that detects assets references relative to modules using patterns such as `new URL('./path/to/asset.ext', import.meta.url)`. The assets are added to the rollup pipeline, allowing them to be transformed and hash the filenames.
Rollup plugin that detects assets references relative to modules using patterns such as `new URL('./assets/my-img.png', import.meta.url)`.
The referenced assets are added to the rollup pipeline, allowing them to be transformed and hash the filenames.
## How it works
A common pattern is to import an asset to get the URL of it after bundling:
```js
import myImg from './assets/my-img.png';
```
This doesn't work in the browser without transformation. This plugin makes it possible to use an identical pattern using `import.meta.url` which does work in the browser:
```js
const myImg = new URL('./assets/my-img.png', import.meta.url);
```
## Install

@@ -6,0 +22,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc