Skip to content

Commit

Permalink
Merge pull request #144 from humanmade/mattheu-patch-1
Browse files Browse the repository at this point in the history
Update CONTRIBUTING.md guidelines with additional info on using npm link.
  • Loading branch information
tomjn authored Jul 24, 2023
2 parents 672f189 + b7ef92b commit 171d597
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ When you're done, you can unlink the package by running the following:
npm unlink @humanmade/block-editor-components
```

**Note on usage with `@humanmade/webpack-helpers`:** You may hit eslint errors trying to build your assets when linked to a local copy of this. As a workaround, you need to restrict eslint to the current project directory when configuring your webpack build. Do this by filtering the loader options.

```
const path = require( 'node:path' );
presets.production( {
// ...
}, {
filterLoaders: ( loader, loaderType ) => {
// Handle symlinked node_modules.
if ( loaderType === 'eslint' ) {
loader.include = path.dirname( path.resolve( __dirname ) );
}
return loader;
}
} );
```

### Automatic Build

Whilst developing, it is useful have Webpack watch for changes and rebuild the distributed files automatically.
Expand Down

0 comments on commit 171d597

Please sign in to comment.