diff --git a/.gitignore b/.gitignore index 3c3629e..b7dab5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +build \ No newline at end of file diff --git a/package.json b/package.json index 1a40d0a..260205f 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,11 @@ "name": "timeliner", "version": "1.5.0", "description": "simple js animation timeline library", - "main": "timeliner.js", + "main": "build/index.js", + "module": "build/index.es.js", + "browser": "build/timeliner.min.js", "scripts": { - "build": "rollup src/timeliner.js > build/timeliner.js", + "build": "rollup -c", "mini": "rollup -c rollup.config.js", "watch": "watchify src/timeliner.js --full-paths=false -t package-json-versionify --debug -o timeliner.js -v", "start": "npm run watch", @@ -34,9 +36,13 @@ "devDependencies": { "do.js": "^1.0.0", "rollup": "^2.10.2", - "rollup-plugin-terser": "^5.3.0" + "rollup-plugin-terser": "^5.3.0", + "package-json-versionify": "^1.0.4" }, "dependencies": { "eslint": "^7.0.0" + }, + "publishConfig": { + "access": "public" } } diff --git a/rollup.config.js b/rollup.config.js index 22830a0..eda3ffe 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,10 +1,10 @@ -simport { terser } from "rollup-plugin-terser"; +import { terser } from "rollup-plugin-terser"; export default { input: 'src/timeliner.js', output: [ - { file: "build/lib.js", format: "cjs" }, + { file: "build/index.js", format: "cjs" }, { file: "build/timeliner.min.js", plugins: [terser()] }, - { file: "build/timeliner.js", format: "esm" } + { file: "build/index.es.js", format: "esm" } ] }; \ No newline at end of file