mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: 移除 getHostname、getPort、getServer
This commit is contained in:
parent
97b9e8fa3c
commit
a366f9694a
@ -3,18 +3,13 @@ import vue from '@vitejs/plugin-vue';
|
|||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||||
import SFCConfigBlockPlugin from './SFCConfigBlockPlugin';
|
import SFCConfigBlockPlugin from './SFCConfigBlockPlugin';
|
||||||
|
|
||||||
const assert = require('assert');
|
|
||||||
|
|
||||||
export default (api) => {
|
export default (api) => {
|
||||||
const {
|
const {
|
||||||
env,
|
|
||||||
paths,
|
paths,
|
||||||
utils: { chalk },
|
utils: { chalk },
|
||||||
} = api;
|
} = api;
|
||||||
|
|
||||||
const unwatchs = [];
|
const unwatchs = [];
|
||||||
let port;
|
|
||||||
let hostname;
|
|
||||||
let server;
|
let server;
|
||||||
|
|
||||||
function destroy() {
|
function destroy() {
|
||||||
@ -63,30 +58,6 @@ export default (api) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getPort',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getPort() is only valid in development.');
|
|
||||||
return port;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getHostname',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getHostname() is only valid in development.');
|
|
||||||
return hostname;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getServer',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getServer() is only valid in development.');
|
|
||||||
return server;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
api.registerMethod({
|
||||||
name: 'restartServer',
|
name: 'restartServer',
|
||||||
fn() {
|
fn() {
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
* https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/dev/dev.ts
|
* https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/dev/dev.ts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('assert');
|
|
||||||
|
|
||||||
export default (api) => {
|
export default (api) => {
|
||||||
const {
|
const {
|
||||||
env,
|
|
||||||
paths,
|
paths,
|
||||||
utils: { chalk, portfinder, generateFiles },
|
utils: { chalk, portfinder, generateFiles },
|
||||||
} = api;
|
} = api;
|
||||||
@ -165,30 +162,6 @@ export default (api) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getPort',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getPort() is only valid in development.');
|
|
||||||
return port;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getHostname',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getHostname() is only valid in development.');
|
|
||||||
return hostname;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
|
||||||
name: 'getServer',
|
|
||||||
fn() {
|
|
||||||
assert(env === 'development', 'api.getServer() is only valid in development.');
|
|
||||||
return server;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
api.registerMethod({
|
api.registerMethod({
|
||||||
name: 'restartServer',
|
name: 'restartServer',
|
||||||
fn() {
|
fn() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user