Code Monkey home page Code Monkey logo

crx-dev-server's Introduction

crx-dev-server

A dev "server" for Chrome extensions with hot reload capabilities.

Installation

$ npm i --save-dev crx-dev-server

Usage

By default, this package will look for a manifest.json definition in process.cwd().

$ crx-dev-server

If you wish to use a manifest.json from a different location, simply specify the path via the --manifest command-line option:

$ crx-dev-server --manifest=/path/to/your/manifest.json

How does it work?

This package injects a background script (see crx-hotreload) into your project's manifest.json that watches for file changes and auto-reloads your extension when they occur.

The background script (hot-reload.js) is copied into your project alongside your manifest.json (Chrome requires content and background scripts be local and relative to your manifest.json), then removed when the server is stopped.

Motivation

I love the work that went into crx-hotreload as it makes my life easier as an extension developer, but I wanted a way to keep the background script definition out of my manifest.json so I could ship the extension without dev assets.

You can achieve something similar with a CI/CD pipeline, but that isn't necessarily applicable to every project.

crx-dev-server's People

Contributors

zdoc01 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.