Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Add documentation for liferay-npm-bundler plugins #24

Merged
merged 3 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# liferay-npm-bundler-plugin-inject-angular-dependencies

> Inject some peer dependencies which are needed to make Angular work.

## Installation

```sh
npm install --save-dev liferay-npm-bundler-plugin-inject-angular-dependencies
```

## Usage

Add the following to your `.npmbundlerrc` file:

```json
{
"*": {
"plugins": [
"inject-angular-dependencies"
]
}
}
```

## Technical Details

This plugin injects a dependency on `rxjs` in `@angular/forms` package. This is
needed for Angular to work correctly under Liferay Portal npm architecture.

To determine the version of `rxjs` to use, the plugin scans the parent directory
of `@angular/forms` for the `rxjs` package.

You can find more information about what happens with `rxjs` and
`@angular/forms` in
[this issue](https://github.com/angular/angular/issues/17917).
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# liferay-npm-bundler-plugin-replace-browser-modules

> Replace modules listed under `browser` section of `package.json` files.

## Installation

```sh
npm install --save-dev liferay-npm-bundler-plugin-replace-browser-modules
```

## Usage

Add the following to your `.npmbundlerrc` file:

```json
{
"*": {
"plugins": [
"replace-browser-modules"
]
}
}
```

## Technical Details

This plugin scans `package.json` for a browser entry and copies browser modules
on top of server modules or deletes them when set to `false`.

Please read the
[`browser` field specification](https://github.com/defunctzombie/package-browser-field-spec)
for more information.