vue-date-picker
vue-date-picker copied to clipboard
Install dependencies and update webpack and babel with latest improvements
As I've seen in the code, you put dependencies from lodash directly in the code with a comment "to avoid dependencies". Lodash has modules splitted by module, so you can install chunk and split from lodash. It has many improvements:
- The final user will have the latest decision: to pack or not to pack the dependencies inside the code.
- The final user will do a npm or yarn installation. This will allow npm or yarn to resolve duplicates on code and do a better dependency tree.
- It's a standard in node, and vue follows commonjs modules to work, so it's a better practice to follow the standard.
Babel and Webpack with newer versions will allow us to have a better support, faster builds and a better config file. Also we could use other tools to improve coding with latest versions of they, like eslint with airbnb or javascript-standard. Also babel is throwing a warning as they have done a presset called "env", so it will allow you to put a target like this:
{ "targets": { "browsers": ["last 2 versions", "safari >= 7"], }, }
I could do all the work for you, so you or someone else can merge those changes. Let's discuss what do you think about all this changes.
So just adding the chunk and split functions as imported dependencies from lodash? That makes sense, I actually asked some people about dependencies in libraries and they seemed to lean towards the "no dependencies" part, although I'm not sure if they understood that my "library" would just be a vue component, maybe I could have articulated that better. If you want to remove that and add the chunk/split modules as dependencies, and change the preset to env for babel, feel free to and I'll merge it