Skip to content

Commit d4515af

Browse files
committed
Adding types
1 parent ebb9ea2 commit d4515af

4 files changed

Lines changed: 229 additions & 102 deletions

File tree

vitejs/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default backloop;
2+
declare function backloop(hostname?: string): {
3+
name: string;
4+
apply: string;
5+
config(options: any): void;
6+
};

vitejs/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
*/
55
import backloopHttpsOptions from 'backloop.dev';
66

7-
function backloop(hostname = 'whatever') {
7+
function backloop(hostname = 'whatever', port) {
88
console.log({hostname});
99
return {
1010
name: 'backloop.dev',
1111
apply: 'serve',
1212
config(options) {
1313
options.server = options.server || {};
14-
options.server.host = `${hostname}.backloop.dev`,
15-
options.server.https = backloopHttpsOptions
14+
options.server.host = `${hostname}.backloop.dev`;
15+
options.server.https = backloopHttpsOptions;
16+
options.server.port = port || options.server.port;
1617
}
1718
}
1819
}

0 commit comments

Comments
 (0)