davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
331 stars 11 forks source link

How to set up w/ Docusaurus #55

Open jasikpark opened 2 years ago

jasikpark commented 2 years ago

I ended up using https://github.com/atomicpages/docusaurus-plugin-module-alias to get alias-hq to work with https://docusaurus.io

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

...
const hq = require('alias-hq');

/** @type {import('@docusaurus/types').Config} */
const config = {
  ...
  plugins: [
    [
      'docusaurus-plugin-module-alias',
      {
        alias: hq.get('webpack'),
      },
    ],
  ],
  ...
};

module.exports = config;

Just wanted to record this for anyone else who might need it in the future

davestewart commented 1 year ago

Hey @jasikpark, thanks!

I don't know much about Docusaurus. You think this would be worth adding to the integrations docs?

Do you have a link to the docs for Docusuarus config?

jasikpark commented 1 year ago

https://docusaurus.io/docs/configuration this? I think it would be useful for sure :p

This is a great tool 😁 it's been nice to be able to use a single config across web frameworks for aliases: Docusaurus & Astro & Vite all the same