diff --git a/.gitignore b/.gitignore index c2658d7..1eae0cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +dist/ node_modules/ diff --git a/index.js b/index.js index 7511a64..9be793e 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ const getAcorn = Parser => { return acorn } -module.exports = function(Parser) { +export default function privateClassElements(Parser) { // Only load this plugin once. if (Parser.prototype.parsePrivateName) { return Parser diff --git a/package.json b/package.json index d17c20b..61cfe81 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "contributors": [ "Adrian Heine " ], + "main": "dist/acorn-private-class-elements.js", + "module": "dist/acorn-private-class-elements.mjs", "engines": { "node": ">=4.8.2" }, @@ -14,17 +16,19 @@ }, "license": "MIT", "scripts": { + "build": "rollup -c rollup.config.js", "test": "mocha", "lint": "eslint -c .eslintrc.json ." }, "peerDependencies": { "acorn": "^6.1.0 || ^7 || ^8" }, - "version": "0.2.7", + "version": "0.2.8", "devDependencies": { "acorn": "^7.0.0", "eslint": "^7", "eslint-plugin-node": "^11.0.0", - "mocha": "^8" + "mocha": "^8", + "rollup": "^2.10.0" } } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..6cee364 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,15 @@ +export default { + input: "index.js", + output: [ + { + file: "dist/acorn-private-class-elements.js", + format: "cjs", + sourcemap: true + }, + { + file: "dist/acorn-private-class-elements.mjs", + format: "es", + sourcemap: true + } + ] +}