devbundle

Bundle and browser test JavaScript modules during development

this package has been deprecated
Last updated 3 years ago by henit .
MIT · Original npm · Tarball · package.json
$ cnpm install devbundle 
SYNC missed versions from official npm registry.

devbundle

Bundle and browser test JavaScript modules during development

Installation

npm install devbundle

Usage

  • Add an initiate script
// devbundle.js
import devbundle from "devbundle";

devbundle({
    context: __dirname,
    input: __dirname + "/index.js",
});
  • Run initiate script using Node.js
node devbundle.js

Configs

Required

  • context: Path to the main project directory where the module is running
  • input: Path to input script for the bundle (javascript file)

Optional

  • title: Title, used in the presented index html
  • icon: Presentation icon, available: app, camera, chart, chat, cloud, cube (default), html, location, music, phone, plane, pointer, shield, shopping, users, windows
  • include: Static files to include in the html presentation
  • include.css: Array of static css include file paths
  • include.js: Array of static jsvascript include file paths
  • port: Web server port
  • hostname: Web server hostname

Extended example

import devbundle from "devbundle";

devbundle({
    context: __dirname,
    input: __dirname + "/index.js",
    title: "Development test"
    include: {
        css: [
            __dirname + "/styles.css"
        ],
        js: [
            __dirname + "/scripts.js"
        ]
    },
    port: 8081,
    hostname: "localhost"
});

What it does

  • Builds the input files with all dependencies into a single bundle (using Webpack)
    • Including ES6 to ES3 transpiling
    • Including JSX compilation (React)
    • Including SASS compilation
  • Saves bundle to memory, and watch for changes
  • Start a local web server presenting an index html with the bundle
  • Include static files in the index

License

MIT

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Current Tags

  • 0.2.4                                ...           latest (3 years ago)

7 Versions

  • 0.2.4 [deprecated]           ...           3 years ago
  • 0.2.3 [deprecated]           ...           3 years ago
  • 0.2.2 [deprecated]           ...           3 years ago
  • 0.2.1 [deprecated]           ...           3 years ago
  • 0.2.0 [deprecated]           ...           3 years ago
  • 0.1.1 [deprecated]           ...           3 years ago
  • 0.1.0 [deprecated]           ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 1
Last Week 1
Last Month 0
Dependencies (11)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |