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

@vercel/webpack-asset-relocator-loader

Package Overview
Dependencies
Maintainers
9
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/webpack-asset-relocator-loader

Asset relocation loader used in ncc for performing Node.js builds while emitting and relocating any asset references.

  • 1.7.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
188K
decreased by-17.31%
Maintainers
9
Weekly downloads
 
Created

What is @vercel/webpack-asset-relocator-loader?

@vercel/webpack-asset-relocator-loader is a Webpack loader that helps in relocating assets referenced in JavaScript files. It is particularly useful for bundling Node.js applications where assets need to be moved to a specific location in the output directory.

What are @vercel/webpack-asset-relocator-loader's main functionalities?

Relocate Assets

This feature allows you to relocate assets referenced in JavaScript files to a specified directory in the output. The code sample demonstrates how to configure the loader to move assets to the 'assets' directory.

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader: '@vercel/webpack-asset-relocator-loader',
          options: {
            outputAssetBase: 'assets',
          },
        },
      },
    ],
  },
};

Inline Asset Handling

This feature allows you to inline assets directly into the JavaScript bundle. The code sample shows how to configure the loader to inline assets.

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader: '@vercel/webpack-asset-relocator-loader',
          options: {
            inline: true,
          },
        },
      },
    ],
  },
};

Custom Asset Extensions

This feature allows you to specify custom extensions for assets that need to be relocated. The code sample demonstrates how to configure the loader to handle '.wasm' and '.node' files.

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        use: {
          loader: '@vercel/webpack-asset-relocator-loader',
          options: {
            extensions: ['.wasm', '.node'],
          },
        },
      },
    ],
  },
};

Other packages similar to @vercel/webpack-asset-relocator-loader

FAQs

Package last updated on 16 May 2024

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