Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
monta-plugin-resources
Advanced tools
Provides a system to load, include and transform static assets and page resources
Resource system and pipeline for Monta
Not ready for use yet, missing major features.
The resource plugin is the foundation for loading and processing static assets, like stylesheets, script files and images.
This plugin is primarily designed for use with static site generators
(SSG's) and pre-rendered pages. Because the plugin processes the
resource files on each render()
call, it's not very well suited for
real-time rendering. This may be improved upon later, but it's currently
not the main focus of this plugin.
Install Monta and the plugin into your project's dependencies
yarn add monta monta-plugin-resources
Use in your templates
<html>
<head>
<!-- Bundle files with static urls -->
<link rel="stylesheet" href="${ get('stylesheet.css') | toUrl() }">
<!-- Or inline them -->
<style type="text/css">
${ get('stylesheet.css') | inline() }
</style>
</head>
<body>
<!-- Works for images too -->
<img src="${ get('image.png') | toUrl() }">
<!-- Most image types will automatically be inlined as base64 -->
<img src="${ get('image.png') | inline() }">
</body>
</html>
<!-- Get a file -->
${ get('path/to/file.css') }
<!-- Save to a static file and return the URL -->
<link href="${ get('style.css') | toUrl() }">
<img src="${ get('image.jpg') | toUrl() }">
<!-- Return the file as a base64-encoded string -->
<style>${ get('style.css') | inline() }</style>
<img src="${ get('...') | inline() }">
<!-- Loop over multiple files -->
${ get('*.css') | foreach(): }
<link href="${ this | toUrl() ">
${ :end }
${ get('*.(png|jpg)') | foreach(): }
<img src="${ this | toUrl() ">
${ :end }
<!-- Concatenate files -->
${ get('*.css') | concat('styles.css') | toUrl() }
<!-- Minify css or js files -->
${ get('stylesheet.css') | minify() | toUrl() }
${ get('script.js') | minify() | toUrl() }
FAQs
Provides a system to load, include and transform static assets and page resources
The npm package monta-plugin-resources receives a total of 0 weekly downloads. As such, monta-plugin-resources popularity was classified as not popular.
We found that monta-plugin-resources demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.