Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
readme revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
James A Gorrie committed Feb 28, 2019
1 parent a9ace2e commit 13b9b3e
Show file tree
Hide file tree
Showing 5 changed files with 1,086 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Makes it easy to have local libraries and keep a slick, manageable dev experienc
## Installation

```
npm install --save next-transpile-modules
npm install --save @weco/next--plugin-transpile-modules
```

or

```
yarn add next-transpile-modules
yarn add @weco/next--plugin-transpile-modules
```

## Usage
Expand All @@ -28,7 +28,7 @@ Classic:

```js
// next.config.js
const withTM = require('next-transpile-modules');
const withTM = require('@weco/next-plugin-transpile-modules');

module.exports = withTM({
transpileModules: ['somemodule', 'and-another']
Expand All @@ -41,7 +41,7 @@ Example with `next-typescript`:

```js
const withTypescript = require('@zeit/next-typescript');
const withTM = require('next-transpile-modules');
const withTM = require('@weco/next-plugin-transpile-modules');

module.exports = withTypescript(
withTM({
Expand All @@ -56,7 +56,7 @@ With `next-compose-plugins`:
const withPlugins = require('next-compose-plugins');

const withTypescript = require('@zeit/next-typescript');
const withTM = require('next-transpile-modules');
const withTM = require('@weco/next-plugin-transpile-modules');

module.exports = withPlugins([
[withTM, {
Expand All @@ -70,11 +70,6 @@ module.exports = withPlugins([

## FAQ

### What is the difference with `@weco/next-plugin-transpile-modules`?

- it is maintained, `@weco`'s seems dead
- it supports TypeScript

### I have trouble making it work with Next.js 7

Next.js 7 introduced Webpack 4 and Babel 7, [which changed a couple of things](https://github.com/zeit/next.js/issues/5393#issuecomment-458517433), especially for TypeScript and Flow plugins.
Expand All @@ -100,7 +95,7 @@ So you are probably [using it wrong](https://github.com/martpie/next-transpile-m
You may need to tell your Webpack configuration how to properly resolve your scoped packages, as they won't be installed in your Next.js directory, but the root of your Lerna setup.

```js
const withTM = require('next-transpile-modules');
const withTM = require('@weco/next--plugin-transpile-modules');

module.exports = withTM({
transpileModules: ['@your-project/shared', '@your-project/styleguide'],
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@weco/next-plugin-transpile-modules",
"version": "2.0.1",
"version": "2.0.2",
"main": "index.js",
"license": "MIT",
"author": "Wellcome Collection <[email protected]>",
Expand Down
Loading

0 comments on commit 13b9b3e

Please sign in to comment.