Skip to content

Commit

Permalink
fix: ensure package works as a module
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakas committed Apr 14, 2023
1 parent c36ab5b commit de4b67b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
"name": "react-dropzone",
"description": "Simple HTML5 drag-drop zone with React.js",
"main": "dist/index.js",
"module": "dist/es/index.js",
"module": "dist/es/index.mjs",
"exports": {
".": {
"import": "./dist/es/index.mjs",
"require": "./dist/index.js"
}
},
"sideEffects": false,
"scripts": {
"cz": "git-cz",
"clean": "rimraf ./dist",
"build": "yarn clean && yarn build:umd && yarn build:es",
"build:umd": "cross-env NODE_ENV=es rollup -c",
"build:es": "cross-env BABEL_ENV=es babel ./src --out-dir ./dist/es --ignore '**/*.spec.js'",
"build:es": "cross-env BABEL_ENV=es babel ./src --out-dir ./dist/es --out-file-extension .mjs --ignore '**/*.spec.js'",
"start": "styleguidist server",
"styleguide": "styleguidist build",
"test": "cross-env NODE_ENV=test yarn lint && jest --coverage && yarn typescript",
Expand Down
4 changes: 3 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import accepts from "attr-accept";
import _accepts from "attr-accept";

const accepts = typeof _accepts === "function" ? _accepts : _accepts.default;

// Error codes
export const FILE_INVALID_TYPE = "file-invalid-type";
Expand Down

0 comments on commit de4b67b

Please sign in to comment.