Skip to content

Commit

Permalink
Merge pull request #20 from atfzls/patch-1
Browse files Browse the repository at this point in the history
Show ts-loader usage
  • Loading branch information
zerkalica authored Nov 22, 2019
2 parents 0eb47fe + 51c6130 commit ea49f32
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/ts-transform-paths/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,32 @@ export default {
})
}
```
## Setup For [ts-loader](https://github.com/TypeStrong/ts-loader)

```js
const tsTransformPaths = require('@zerollup/ts-transform-paths');

module.exports = {
module: {
rules: [
{
test: /\.(ts|tsx)$/,
loader: 'ts-loader',
options: {
getCustomTransformers: (program) => {
const transformer = tsTransformPaths(program);

return {
before: [transformer.before], // for updating paths in generated code
afterDeclarations: [transformer.afterDeclarations] // for updating paths in declaration files
};
}
}
}
]
}
};
```

## Plugin options

Expand Down

0 comments on commit ea49f32

Please sign in to comment.