LoginSignup
1
1

More than 5 years have passed since last update.

webpack+babel な環境で yarn link XXX で入れたパッケージを使った時にbabel-plugin関連で怒られる時

Last updated at Posted at 2017-06-20

今作業してるプロジェクトではbabel-plugin-xxxを使ってるけど、XXXプロジェクトではそのプラグインを使っていない様な場合に起きるそう。

ERROR in /aaa/bbb/.../eee/fff.js
  Module build failed: ReferenceError:
    Unknown plugin "transform-decorators-legacy" specified in "base" at 0,
    attempted to resolve relative to "/aaa/bbb/.../eee"...

解決方法

babel-loaderexcludeでXXXプロジェクトも除外されるようにする。

      {
        test: /\.js$/,
        exclude: /node_modules|XXX/,
        loader: 'babel-loader',
        options: {
          plugins: ['transform-decorators-legacy']
        }
      },

resolve.symlinksfalseを指定する

何か問題がない限りはこっちを使ったらいいと思います。

  resolve: {
    /* ... */
    symlinks: false
  },
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1