1.0.2 • Published 6 years ago

opn-webpack-plugin v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

opn-webpack-plugin

A plugin for webpack to open resource when complie is done. It's useful for developers, open your website when it's ready.

As this plugin is based on opn, so you can open any resources that opn support.

Installation

npm i opn-webpack-plugin -D

Usage

Require the plugin and add it to the plugins in webpack config.

const OpnWebpackPlugin = require('opn-webpack-plugin');

module.exports = {
    entry: path.resolve(__dirname, 'lib/entry.js'),
    output: {
        path: __dirname + "/bundle/",
        filename: "bundle.js"
    },
    plugins: [
        new OpnWebpackPlugin({
            target: 'http://localhost:8000',
            options: {}
        })
    ]
};

Options

target

Type: String
Default: http://localhost:8000

options

Type: Object
Default: {}
Same with options in opn. The plugin will open website with: opn(target, options), so you can pass any valid options in opn to the plugin.

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago