Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@caviar/plugin-resolve-alias

kaelzhang4MITdeprecated2.0.0

please use "@caviar/next-resolve-alias-plugin" instead

Caviar plugin to define module resolving aliases for both server side and client side

@caviar/plugin-resolve-alias, caviar-plugin, caviar, webpack, webpack-config, resolve-alias

readme

Build Status Coverage

@caviar/plugin-resolve-alias

Caviar plugin to define module resolving aliases for both server side and client side

Install

$ npm i @caviar/plugin-resolve-alias

Usage

caviar.config.js

const AliasPlugin = require('@caviar/plugin-resolve-alias')

module.exports = {
  plugins: [
    new AliasPlugin({
      fetch: {
        server: 'node-fetch',
        client: 'fetch-ponyfill'
      }
    })
  ],
  ...
}

The code above will set webpack.output.resolve.alias.fetch as

  • 'node-fetch' in server side
  • and 'fetch-ponyfill' in client side

License

MIT

changelog

History