diff --git a/package.json b/package.json index 2de0fb0..43a177e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-cli-plugin-envhot", - "version": "0.1.0", + "version": "1.0.0", "description": "hot reloading your .env files, never worry about restarting yor wde", "main": "lib/index.js", "scripts": { diff --git a/src/EventEmitter.ts b/src/EventEmitter.ts index 73b847c..b413b4c 100644 --- a/src/EventEmitter.ts +++ b/src/EventEmitter.ts @@ -6,8 +6,6 @@ export class EventEmitter { } on(event: string, callback: Function) { - this.listeners; - if (!this.listeners[event]) { this.listeners[event] = [callback]; } else { diff --git a/src/index.ts b/src/index.ts index 38245d6..aa41b6c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,9 +13,6 @@ const envFiles = [ ]; module.exports = (api: PluginAPI) => { - // console.log(api.hasPlugin("DefinePlugin")); - // api.version - api.chainWebpack((config) => { config.plugins.get("define").tap(runtimeValueFactory); }); diff --git a/src/parseEnv.ts b/src/parseEnv.ts index 28a3b95..fcee495 100644 --- a/src/parseEnv.ts +++ b/src/parseEnv.ts @@ -14,7 +14,9 @@ export default (files: Array) => { if (existsSync(file)) { const { error, parsed } = config({ path: file }); if (error) throw new Error(`error parsing ${file}: ${error}`); - Object.entries(parsed).forEach(([k, v]) => storage.setValue(k, v)); + Object.entries(parsed).forEach(([k, v]) => + storage.setValue(k, v as string) + ); } }); diff --git a/src/storage.ts b/src/storage.ts index 59d9641..fdd1f01 100644 --- a/src/storage.ts +++ b/src/storage.ts @@ -35,7 +35,6 @@ class Storage { keys2: string[], event ): { event: string; key: string }[] { - console.log(event); return keys1 .filter((key) => { if (keys2.indexOf(key) === -1) {