Posts

Showing posts from October, 2020

Vue Js & Papa Parse (Part II): Parsing server side CSVs without webpack / vue-cli bundling / code splitting

In my previous post on Papa Parse and Vue JS, I detailed how to dynamically import CSVs using the vue-cli / webpack.  We covered some issues that we could run into, and finally how to use the file loader correctly with the import statement. Here is a specific requirement that I ran into :  I needed to dynamically import and parse CSVs that reside inside the project / on the server, but I didn't want webpack to include all of these because I needed to replace the CSVs without having to recompile the whole project Code Splitting and Bundling Webpack's code splitting and bundling are some of the best features that webpack provides your project, but it can sometimes get in the way.  There are plenty of articles on the topic, but Webpack will divide up your code into bundles in order to optimize the number of times your project requests data from the server. The issue: Dynamic imports will include ALL of  your CSVs directly into the bundles.  What happens if you don...