I am moderately new to webpack and have been struggling with this for a while, and need some help.
This repo: github.com/gkindel/CSV-JS
I cannot get to be built with webpack. It throws the error:
WARNING in ./bower_components/CSV-JS/csv.js
Critical dependencies:
203:20-27 require function is used in a way in which dependencies cannot be statically extracted
Here is how I try to use it:
// CSV-JS used by angular ui-grid CSV importer
window.CSV = require('../bower_components/CSV-JS');
The line it is failing on looks like this:
CSV.stream = function () {
var s = new require('stream').Transform({objectMode: true});
...
I am pretty sure ui-grid does not use this function in the library, but webpack has to parse the entire file. I am guessing this is functionality to use in a node environment.
Anyway, anyone have a way of loading this dependency? Or perhaps an alternative library? (not sure if this is possible though, because ui-grid depends on the CSV.parse() function).