Home Reference Source
import {ProjextRollupDevServerPlugin} from 'projext-plugin-rollup/src/plugins/devServer/index.js'
public class | source

ProjextRollupDevServerPlugin

This a Rollup plugin that runs a dev server for a bundled application.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

The name of the plugin's instance.

public

The server URL.

Method Summary

Public Methods
public

Gets the plugin options

public

Gets a "sub plugin" that logs the dev server URL.

public

This is called after Rollup finishes writing the files on the file system.

Public Constructors

public constructor(options: ProjextRollupDevServerPluginOptions, name: string) source

Params:

NameTypeAttributeDescription
options ProjextRollupDevServerPluginOptions
  • optional
  • default: {}

The options to customize the plugin behaviour.

name string
  • optional
  • default: 'projext-rollup-plugin-dev-server'

The name of the plugin's instance.

Public Members

public name: string source

The name of the plugin's instance.

public url: string source

The server URL.

Public Methods

public getOptions(): ProjextRollupDevServerPluginOptions source

Gets the plugin options

public showURL(): Object source

Gets a "sub plugin" that logs the dev server URL. The idea is to put this at the end of the plugins queue so the final feedback the user gets is the URL.

Return:

Object

public writeBundle() source

This is called after Rollup finishes writing the files on the file system. It checks if there's an instance of the server running and if there isn't, it creates a new one.