Skip to content

Support for Alias HQ #106

Open
Open

Description

@davestewart

Hey @ilearnio,

I've just released a package called Alias HQ:

It's an end-to-end solution for configuring, refactoring, maintaining and using path aliases.

Was doing some research on how to use aliases with Node, and this lib came up.

I've added it as a ticket to support this library:

That will be another way to solve #105, at least in the front end world.

If you have any thoughts, let me know!

Activity

  1. davestewart commented on Sep 9, 2020

    @davestewart
    Author

    OK, this was super-easy and very meta!

    As an experiment, I wanted to update Alias HQ to use aliases itself:

    • I wrote an Alias HQ Node plugin to remap the Alias HQ Webpack plugin.
    • I then used the Alias HQ CLI to convert all relative paths of Alias HQ itself.
    • Finally:
      • I called the plugin
      • which calls your API
      • which allows Alias HQ to load itself... using aliases!

    image

    The plugin is this:

    const moduleAlias = require('module-alias')
    const webpack = require('../webpack')
    
    module.exports = function (config, options) {
      const paths = webpack(config, options)
      Object.keys(paths).forEach(key => {
        moduleAlias.addAlias(key, paths[key])
      })
      return true
    }

    Implementation is this:

    require('alias-hq').get('node')
  2. davestewart commented on Sep 9, 2020

    @davestewart
    Author
  3. Kehrlann commented on Sep 25, 2020

    @Kehrlann
    Collaborator

    Hey @davestewart , sorry, I've been quite busy lately ! Just wanted to let you know I'll take a look next week.

  4. davestewart commented on Sep 25, 2020

    @davestewart
    Author

    Hey, no worries! I know what it's like trying to keep a hand on all the OSS projects. They are constantly asking for time you don't always have 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions