Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

astros-asset-parse

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astros-asset-parse

Astros 中间件

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

##astro-asset-parse

Astros 中间件

该中间件实现了URL和资源的映射机制。如:

页面home的JS引用路径为:http://cdn/js/p/home.js,对应的Asset属性

属性
modTypepage
fileTypejs
namehome

如果需要自定义资源访问路径(如通过 http://cdn/js/page/home.js访问页面JS),你可以通过实现自己的中间件替换 astro-asset-parse来实现。

####资源引用

本插件定义的资源访问规则如下:

页面|JS| http://cdn/**js**/**p**/login.js web组件|JS| http://cdn/**js**/**webcom**/header.js js组件|JS| http://cdn/**js**/**jscom**/dialog.js 共用资源|js| http://cdn/**js**/**jquery**.js 页面|CSS| http://cdn/**css**/**p/login**.css web组件|CSS| http://cdn/**css**/**webcom**/header.css js组件|CSS| http://cdn/**css**/**jscom**/dialog.css 页面|img| http://cdn/**img**/**p/banner**.png web组件|img| http://cdn/**img**/**webcom**/logo.png js组件|img| http://cdn/**img**/**jscom**/close.png 共用资源|img| http://cdn/**img**/**avatar**.png

FAQs

Package last updated on 22 Jun 2016

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