npm.io
2.1.0 • Published 10 months ago

ray-plugins

Licence
MIT
Version
2.1.0
Deps
5
Size
27 kB
Vulns
0
Weekly
0

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' },
    ]),
  ],
};

Keywords