I’ve finally decided to do that step and move from my old school JS workflow to
trendy modern one - which means I need to install npm, webpack,
babel and who knows what else. Most of that stuff was unfamiliar to me so
I’ve tried to understand the whole process of creating a Node project by
doing it myself… but I failed. What went wrong?
Setting up a node
I must admit Webpack (and it’s plugins) is a really weird tool to use. Maybe
it’s me being silly, I’m not sure at this anymore. My opinion on it is:
too good to leave, too bad to stay. And the staying part I definitely owe
to vue-cli which generated all the wicked configuration files and a project
structure for me. I’ve made some minor changes in a
package.json but was
afraid to tweak it even more. Now I finally understand how an elderly person
unfamiliar with using a computer may feel like when in need to perform a little
bit more harder operation.
Npm’s errors are very verbose but at the same time are giving a little of information about the cause of an error. For instance: accidentally I tried to run a second node development server and from logs I couldn’t read that the failure is due to a port being already in use, I only was noticed that it is probably not a problem with node but my package. Touché.
After I finally created a node project I was able to move one of my Vue
components from a regular JS and a HTML template to a separate
That was not a bad experience at all. Vue compiler is by far much more helpful
than node logs. Or maybe that was some of webpack plugin? Dunno. Anyway,
it was very supportive.
overcomplicated and/or overengineered for me. Me, who was mostly using
jQuery (with plugins stored inside
vendor directory) for years and didn’t
face any major problems with it. I’m really looking forward to see what my
point would be after working with node for some time.
Where are unit tests?
I will fix it in future pushes, I promise.