@architect/plugin-bundles
Advanced tools
Comparing version 3.0.2 to 3.0.4
{ | ||
"name": "@architect/plugin-bundles", | ||
"version": "3.0.2", | ||
"version": "3.0.4", | ||
"description": "plugin-bundles Plugin for exposing bundled modules to the browser from your Architect project.", | ||
@@ -5,0 +5,0 @@ "main": "src/plugins/bundles/index.js", |
@@ -27,23 +27,5 @@ `plugin-bundles | ||
yolo /lib/yolo.mjs | ||
``` | ||
`` | ||
In your lambda handler you now have access to a map with the path to bundled and fingerprinted modules | ||
``` javascript | ||
import map from '@architect/bundles/map.mjs'` | ||
``` | ||
Map will look like this | ||
``` javascript | ||
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. | ||
``` javascript | ||
import map from '@architect/bundles/map.mjs'` | ||
const fingerprintedPath = map['/_bundles/yolo.mjs'] | ||
// fingerprintedPath would be: /_bundles/yolo-232bd6a.mjs | ||
``` | ||
Bundles are will now be available at `/_static/bundles/yolo.mjs` | ||
[If you have fingerprinting turned on then you can use `static.json` to look up the fingerprinted file name.](https://arc.codes/docs/en/guides/frontend/static-assets#fingerprint) |
@@ -54,3 +54,3 @@ const path = require('path') | ||
format: 'esm', | ||
target: [ 'esnext' ], | ||
target: [ 'es2022' ], | ||
platform: 'browser', | ||
@@ -57,0 +57,0 @@ external: [ 'fs', 'path' ], |
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
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
15002
31