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

docusaurus-plugin-module-alias

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docusaurus-plugin-module-alias

A tiny docusaurus 2 plugin for easy module alias creation

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-41.09%
Maintainers
1
Weekly downloads
 
Created
Source

Docusaurus Plugin Module Alias

A small Docusaurus 2.x plugin that simplifies the addition of module aliases.

Installation

npm i --save-dev docusaurus-plugin-module-alias # or
yarn add docusaurus-plugin-module-alias --dev

Why?

Docusaurus 2.x uses webpack to build SSR and client bundles. Creating a plugin to add a module alias for every new docusaurus site can be easily modularized.

Usage

Inside your docusaurus.config.js add to the plugins field and configure with the alias option :+1:

const path = require('path');

module.exports = {
    // ...
    plugins: [
        [
            'docusaurus-plugin-module-alias',
            {
                alias: {
                    '@local/component': path.resolve(__dirname, '../src/index.js'),
                },
            },
        ],
    ],
};

Invalid Aliases

Docusaurus has special aliases that shouldn't be overridden: @site, @generated, @docusaurus, ~docs, ~blog, ~pages, ~debug

Options

NameTypeRequiredDescription
aliasRecord<string, string>YesAliases passes to webpack
mergeStrategyRecord<string, string>NoChange the merge strategy used by webpack-merge. Use with caution!

Keywords

FAQs

Package last updated on 24 Nov 2020

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