Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parcel-plugin-assets-list

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-assets-list

Support assets list input file type

  • 1.0.1
  • npm
  • Socket score

Version published
Weekly downloads
13
Maintainers
1
Weekly downloads
 
Created
Source

Parcel Plugin for Assets Manifest

This plugin adds a new asset file type handler *.assets which reads a file of newline-separated file paths and adds them to the parcel outputs. Each file referenced in the list will be hashed by parcel and copied to the output folder (e.g. dist/)

To use this plugin, install it into your parcel project:

yarn add parcel-plugin-assets-list
# or
npm install parcel-plugin-assets-list

Then create an assets file, for example a file app.assets:

# HTML templates
templates/a.html
templates/b.html

# Stylesheets
scss/styles.scss

# Javascript
js/whatever.js

Now when you build with parcel it will copy those files into dist with a hashed name. In addition it will store the mapping of those files from the original name to the new name in a few ways:

  • app.js: A javascript module you can import from your js files to get a javascript object mapping the name in the file to the resulting hashed filename
  • app.json: A JSON file with the same mapping as above but in raw JSON, for consumption on the server side if you don't use JavaScript on the server.
  • app.assets: A simple text-based file format with the original file path, a colon, a space (:) and the output path. Could be used instead of JSON if you like.

The actual filename depends on the input file name.

FAQs

Package last updated on 19 May 2018

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

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