accurat / accurapp

Create JS apps with flexible build configuration, tailored for the specific needs of Accurat
MIT License
21 stars 5 forks source link

CSV loader #18

Closed nkint closed 6 years ago

nkint commented 7 years ago

Now done with:

yarn add -D csv-loader

and in webpack.config.js:

const buildWebpackConfig = require('webpack-preset-accurapp')
module.exports = buildWebpackConfig([
  (context) => ({
    module: {
      loaders: [
        {
          test: /\.csv$/,
          loader: 'csv-loader',
          options: {
            dynamicTyping: true,
            header: true,
            skipEmptyLines: true,
          },
        },
      ],
    },
  }),
])
markov00 commented 7 years ago

I don't like so much the idea behind the csv loader. If it's a relatively small file it is fine, but with large CSV, you will end up having a big bundle.js file with the JSONified CSV in it.

marcofugaro commented 6 years ago

Is there a config for the csv-loader that works for all? We are having a hard time defining it.

How about importing the csv with the raw-loader and parsing it with papaparse or d3 or something else?

Concerning the big csvs issue it's on the developer to be careful with that.

cc @caesarsol

caesarsol commented 6 years ago

It's more useful in the prototyping phase than in production, so the "bundle too big" problem can be forgot.

It's very useful for light data analysis, for example for @gio_magni

marcofugaro commented 6 years ago

Closed in #40