Skip to content

Instantly share code, notes, and snippets.

@mbeaudru
Created February 22, 2019 10:32
Show Gist options
  • Save mbeaudru/fcb1c93bb1ae574c72079fcca2992478 to your computer and use it in GitHub Desktop.
Save mbeaudru/fcb1c93bb1ae574c72079fcca2992478 to your computer and use it in GitHub Desktop.
Yarn PnP identified pain-points

Yarn PnP identified pain-points

Webpack v4 only

pnp-webpack-plugin currently only supports webpack v4, so we have two options for projects (like the current storybook) to work with PnP:

  • make a PR on the pnp-webpack-plugin to add support for webpack < v4
  • update the projects relying on webpack < v4

.babelrc

We currently use babel@6 and this version only support a static .babelrc file. In this file, we declare plugins using an absolute path. This is a problem because now those plugins aren't in a node_modules folder anymore, so it breaks.

Ex:

{
    "plugins": [
        "babel-plugin-transform-es2015-modules-commonjs",
        "babel-plugin-add-module-exports"
    ],
}

eslint

IDE Integration

We are used to run eslint on file save and we rely on the IDE to trigger eslint.

Since eslint is no more found in the node_modules of the project, the IDE configurations we use won't work anymore and we must find another solution for that. Maybe unplug would do the trick.

Husky commit hook

Breaks the precommit hook: sh: lint-staged: command not found

sass-loader and node-sass dependency

facebook/create-react-app#5380 (comment)

https://github.com/webpack-contrib/sass-loader/releases/tag/v7.0.0

webpack-contrib/sass-loader#532

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