# @liferay/dev-server

> **THIS PROJECT IS EXPERIMENTAL**

Latest version **1.0.0** (published 2021-10-08) · LGPL-3.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @liferay/dev-server
pnpm add @liferay/dev-server
yarn add @liferay/dev-server
bun add @liferay/dev-server
```

Provides the command `liferay-dev-server`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-10-08 |
| First published | 2021-10-08 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 74 |
| Author | Liferay Frontend Infrastructure Team |
| Maintainers | liferay |

## Links

- npm: https://www.npmjs.com/package/@liferay/dev-server
- Repository: https://github.com/liferay/liferay-frontend-projects
- npm.io page: https://npm.io/package/@liferay/dev-server

## Dependencies (7)

- [glob](https://npm.io/package/glob.md) ^7.1.7
- [open](https://npm.io/package/open.md) ^8.2.1
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [pkg-up](https://npm.io/package/pkg-up.md) ^3.1.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.2
- [commander](https://npm.io/package/commander.md) ^8.1.0
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.18.1

## Recent versions

- 1.0.0 (latest) — 2021-10-08

## README

# @liferay/dev-server

**THIS PROJECT IS EXPERIMENTAL**

This project is to be used in conjunction with the [liferay-portal](https://github.com/liferay/liferay-portal) repository. The goal of this project is to speed up frontend development speed.

This development server detects changes to Javscript, Typescript, and CSS/SCSS files and automatically runs the build script specified in the module. It then serves those newly built files on `localhost:3000` so that you can see changes without having to re-deploy your module.

## Use

Run this command anywhere in the `liferay-portal` repo.

```sh
$ npx liferay-dev-server
```

This command will spin up a development server on `localhost:3000`. This sever proxies all request to your local instance of Liferay DXP on `localhost:8080`.

## Features

-   Sets up a server at http://localhost:3000
-   Proxies all unkonwn requests to a given Liferay Portal instance (http://localhost:8080 by default)
-   Attempts to map requests of the form /o/moduleName/fileName or /o/js/resolved-module/moduleName/fileName to their output on disk
-   Watches for changes and triggers yarn build on the specific projects
-   Sets up a live-reload mechanism to reload automatically when the build finishes

## Local Development

-   Clone this repo, `liferay-frontend-projects`
-   Navigate `cd projects/js-toolkit/packages/dev-server/`
-   Run `yarn link`
-   Run typescript compiler `yarn watch`
-   Open second terminal in `liferay-portal` repo
-   Run `liferay-dev-server`
-   Make changes to files in `liferay-frontend-projects/projects/js-toolkit/packages/dev-server/`

## Caveats

Probably a lot, which is why this is currently experimental. 😄

---
_Source: https://npm.io/package/@liferay/dev-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
