write-hosts-plugin
v1.1.1
Published
A plugin to write hosts file
Downloads
4
Readme
write-hosts-plugin
解决项目需要在指定域下运行,启动项目时自动写入hosts配置
安装
npm install write-hosts-plugin -D
使用
vite
// vite.config.js
import WriteHosts from 'write-hosts-plugin/src/vite';
export default {
plugins: [
WriteHosts({
hosts: {
'dev.test': '127.0.0.1',
'api.test': '12.34.56.78'
}
})
]
}
webpack
// webpack.config.js
const WriteHost = require('write-hosts-plugin/src/webpack');
module.exports = {
plugins: [
new WriteHost({
hosts: {
'dev.test': '127.0.0.1',
'api.test': '12.34.56.78'
}
})
]
};