ray-plugins

2.0.1 • Public • Published

ray-plugins

the plugins for webpack

author

ilex.h

api

name description
OpenUrlPluginClass es6 直接用默认浏览器打开url
OpenUrlPlugins 直接用默认浏览器打开url
OpenBrowser 直接用默认浏览器打开url
RayShow webpack打包进度展示
RayProgress webpack打包进度展示(推荐使用)
browser `浏览器参数 chrome
tools 常用工具tools.trim(str): 移除字符串前后空格
const OpenBrowser = require('ray-plugins/lib/openBrowser');

const commonConfig = {
  plugins: [
    // open http://localhost:3000 in default browser
    new OpenBrowser({ url: 'http://localhost:3000' }),
    // more options
    // specify firefox to open
    new OpenBrowser({ url: 'http://localhost:3000', browser: 'firefox' }),
    // delay 3 seconds
    new OpenBrowser({ url: 'http://localhost:3000', delay: 3 * 1000 }),
    // By default, this plugin only works when no compile error
    new OpenBrowser({ url: 'http://localhost:3000', ignoreErrors: true }),
    // You can set a group of option to open multiple urls in multiple browsers
    new OpenBrowser([
      { url: 'http://localhost:3000', browser: 'chrome' },
      { url: 'http://localhost:3000', browser: 'firefox' },
    ]),
  ],
};

Readme

Keywords

Package Sidebar

Install

npm i ray-plugins

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

25.2 kB

Total Files

17

Last publish

Collaborators

  • ilex.h