Skip to content

Commit

Permalink
feat: v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
serializedowen committed Aug 20, 2020
1 parent 4762fc9 commit 842383d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 0 additions & 2 deletions src/EventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export class EventEmitter {
}

on(event: string, callback: Function) {
this.listeners;

if (!this.listeners[event]) {
this.listeners[event] = [callback];
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
4 changes: 3 additions & 1 deletion src/parseEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default (files: Array<string>) => {
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)
);
}
});

Expand Down
1 change: 0 additions & 1 deletion src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 842383d

Please sign in to comment.