1

I have already implemented a csv import feature in my app using this plugin, and it works great! But recently I had to reinstall some of my assets and it appears the plugin has some recent additions that include ES15 syntax. My Rails 4 app isn't ready to digest ES15 so I'm looking for a way to exclude the offending files if I can.

The plugin's directory structure looks like this (with some items omitted for brevity).

├── src
│   ├── jquery.csv.js
│   └── jquery.csv.min.js
└── test
    ├── csv.from_array.js
    ├── csv.from_arrays.js
    ├── csv.parsers.js
    ├── csv.to_array.js
    ├── etc ...

The ES15 code only appears in the test/ files. In my assets pipeline I include jquery.csv.js, which apparently includes the test/ files, as it's choking on the ES15 when I precompile assets. (If I don't require jquery.csv.js, assets precompile fine.)

This illustrates the errors I'm seeing when I precompile.

Seems like I should be able to do without the test files, but looking in jquery.csv.js it's not obvious to me how they're being included.

I know I should probably focus on getting Rails upgraded or use webpack/babel/whatever to integrate ES15 but I'm hoping for a short-term fix so I can move forward.

Thanks for any tips!

Ryan
  • 11
  • 1
  • 1
  • I tried the `stub` sprockets directive to try to get it to ignore those files, but that didn't seem to work, so I just modified all the files to remove ES15 (or is it ES6??) features. – Ryan Mar 27 '18 at 15:09

0 Answers0