1.1.1 • Published 9 months ago

write-hosts-plugin v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

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

};
1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago