ES6 module for PapaParse
See original GitHub issueWhile upgrading to Angular 10, using PapaParse gives following warning message - WARNING in C:\parser.component.ts depends on papaparse. CommonJS or AMD dependencies can cause optimization bailouts.
This seems to be because PapaParse is CommonJS module dependency.
I am importing papaparse as follows -
import * as csvParser from 'papaparse';
and using it as -
csvParser.parse(file, {});
Can you help me with an ES6 module that I could use instead?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:17
- Comments:7
Top Results From Across the Web
how to import papaparse in javascript? - Stack Overflow
I installed papaparse using npm install papaparse in my createa folder. However, when I try to do import { Papa } from 'papaparse';...
Read more >Papa Parse - Powerful CSV Parser for JavaScript
The powerful, in-browser CSV parser for big boys and girls. Download Demo Documentation.
Read more >Developers - ES6 module for PapaParse - - Bountysource
While upgrading to Angular 10, using PapaParse gives following warning message - WARNING in C:\parser.component.ts depends on papaparse.
Read more >Papa Parse: Lightning Fast CSV Parsing Experience - codeburst
babel or ES6 */ import papaparse from 'papaparse';/* node or require js */ const papaparse = require('papaparse'); ...
Read more >How to use the papaparse.parse function in papaparse - Snyk
To help you get started, we've selected a few papaparse.parse examples, ... showErrorDialog( `The csv file you are trying to import contains no...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@pokoli That doesn’t seem very relevant at all. ES6 modules are part of modern javascript, they have nothing to do with typescript.
The
import
andexport
keywords are now native to javascript, and you can now isolate your files as modules without wrapping everything in a function that you call (like you do now). If you still want backward compatibility, you can use babel that will generate CommonJS and AMD modules for you. Your code gets cleaner and users of this library can get more aggressive optimization. win-win.TLDR; Having typescript definitions is not enough. We want ES6 modules.
As a first step I’ve created a PR that introduces support in (hopefully) the least backwards incompatible way. The code I’m confident with, build system support less so. Anyone up for some integration testing? PR is https://github.com/mholt/PapaParse/pull/875