ray-plugins
v2.0.1
Published
the plugins for webpack
Downloads
21
Readme
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|firefox
|
|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' },
]),
],
};