@adamkiss/webpack-caddy-proxy 中文文档教程
webpack-caddy-proxy
与您的 Webpack 观察器一起启动/停止 Caddy Server
Usage
const WebpackCaddyProxy = require('webpack-caddy-proxy')
const caddyProxy = new WebpackCaddyProxy({
https: true,
port: 2222,
caddyfile: `${__dirname}/custom/Caddyfile`
})
const config = {
// ...
plugins: [
caddyProxy
],
browserSync: caddyProxy.browserSyncProxy()
}
为我的特定用例制作,此插件在 Webpack 观察器第一次运行时启动,并将 Caddy 进程绑定到观察器,因此当您杀死它时,Caddy 也会被杀死。
此外,一旦设置,它会自动设置 Caddy 和 Browser Sync 的端口(选项中给出的是 Browser Sync),并返回 browserSync 配置对象。 以一种非常愚蠢的方式。
Author & License
© 2018 Adam Kiss
特此授予出于任何目的使用、复制、修改和/或分发此软件的许可,无论是否收费,前提是以上版权声明和本许可声明出现在所有副本中。
本软件“按原样”提供,作者否认与本软件有关的所有保证,包括对适销性和适用性的所有默示保证。 在任何情况下,作者均不对任何特殊的、直接的、间接的或后果性的损害或任何因使用、数据或利润损失而造成的损害负责,无论是在合同行为、疏忽或其他侵权行为中,由于或与本软件的使用或性能有关。
webpack-caddy-proxy
Start/stop Caddy Server together with your Webpack watcher
Usage
const WebpackCaddyProxy = require('webpack-caddy-proxy')
const caddyProxy = new WebpackCaddyProxy({
https: true,
port: 2222,
caddyfile: `${__dirname}/custom/Caddyfile`
})
const config = {
// ...
plugins: [
caddyProxy
],
browserSync: caddyProxy.browserSyncProxy()
}
Made for my particular usecase, this plugin starts the first time Webpack watcher runs, and binds the Caddy process to the watcher, so when you kill it, Caddy is killed as well.
Additionally, once setup, it autosets port for Caddy and Browser Sync (the one given in the options is the Browser Sync), and returns browserSync configuration object. In a very dumb way.
Author & License
© 2018 Adam Kiss
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.