1.0.9 • Published 6 years ago

babel-alias-quokka-plugin v1.0.9

Weekly downloads
236
License
ISC
Repository
github
Last release
6 years ago

babel-alias-quokka-plugin

Quokka plugin to enable babel aliases that have been loaded with babel-plugin-module-resolver.

(these are not required, though, and aliases can be defined at the quokka.alias path of package.json.)

It uses babel-load-config to find the babel config. It then uses it to configure a module resolver from babel-plugin-module-resolver and uses that to resolve modules for Quokka.

Installation:

yarn add babel-alias-quokka-plugin

Then ensure this is in the top level of your package.json

"quokka": {
    "babel": true, // needed for imports
    "plugins": ["babel-alias-quokka-plugin"],
}

Aliases can either be pulled out of the configuration of babel-plugin-module-resolver automatically or you can specify them in package.json (see below)

Example Usages

Via Babel config:

{
  "plugins": [
    [
      "module-resolver",
      {
        "root": ["./"],
        "alias": {
          "test": "./test"
        }
      }
    ]
  ]
}

Via package.json:

  "quokka": {
    "babel": true,
    "plugins": ["babel-alias-quokka-plugin"],
    "alias": {
      "test": "./test"
    }
  }

Testing

To test, open test/index.js in VSCode and start Quokka

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago