diff --git a/esm/index.browser.mjs b/esm/index.browser.mjs new file mode 100644 index 00000000..bdeaa1c6 --- /dev/null +++ b/esm/index.browser.mjs @@ -0,0 +1,2 @@ +import '../papaparse.js'; +export default globalThis.Papa; diff --git a/esm/index.mjs b/esm/index.mjs new file mode 100644 index 00000000..6962c91a --- /dev/null +++ b/esm/index.mjs @@ -0,0 +1,3 @@ +import { createRequire } from 'module'; +const require = createRequire(import.meta.url); +export default require('../papaparse.js'); diff --git a/esm/package.json b/esm/package.json new file mode 100644 index 00000000..6c46b2ee --- /dev/null +++ b/esm/package.json @@ -0,0 +1,4 @@ +{ + "module": "./index.mjs", + "browser": "./index.browser.mjs" +} diff --git a/package.json b/package.json index a0fdc770..e1c35560 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ }, "license": "MIT", "main": "papaparse.js", + "module": "papaparse.mjs", "browser": "papaparse.min.js", "devDependencies": { "chai": "^4.2.0", diff --git a/papaparse.mjs b/papaparse.mjs new file mode 100644 index 00000000..bcea4793 --- /dev/null +++ b/papaparse.mjs @@ -0,0 +1,2 @@ +import Papa from './esm'; +export default Papa;