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

@architect/plugin-bundles

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@architect/plugin-bundles

plugin-bundles Plugin for exposing bundled modules to the browser from your Architect project.

1.1.1
Source
npm
Version published
Weekly downloads
85
93.18%
Maintainers
6
Weekly downloads
 
Created
Source

`plugin-bundles Plugin for exposing bundled modules to the browser from your Architect project.

Install

npm i @architect/plugin-bundles

Usage

In your app.arc file:

@app
bndl-mock

@http
get /yolo

# Define you plugins pragma
@plugins
# Add the plugin bundles module
architect/plugin-bundles

# Define the bundles pragma
@bundles
# Specify which modules to bundle based off of file path.
# . Hint: You can include organization node modules by quoting the path
# . i.e. hashids "@begin/hashids"
yolo /lib/yolo.mjs

In your lambda handler you now have access to a map with the path to bundled and fingerprinted modules

import map from '@architect/views/_bundles/map.mjs'`

Map will look like this

export default {
  "/_bundles/yolo.mjs": "/_bundles/yolo-232bd6a.mjs",
}

In your browser code you can now request modules from /_bundles/ and the response will be the bundled and fingerprinted file.

You can use the map to look up the fingerprinted name.

import map from '@architect/views/_bundles/map.mjs'`
const fingerprintedPath = map['/_bundles/yolo.mjs'] 
// fingerprintedPath would be: /_bundles/yolo-232bd6a.mjs

FAQs

Package last updated on 19 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts