From 51c294b47138e8b9db532d04dbce6e227514ec4b Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sun, 26 Jul 2020 14:17:16 +0200 Subject: [PATCH] Revert previous changes --- .gitignore | 6 +----- package.json | 34 ++++++++++++---------------------- rollup.config.js | 28 +++++++++++----------------- 3 files changed, 24 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 3f5d6de..355eaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ dev -.DS_Store +dist .idea node_modules yarn-error.log -index.js -index.mjs -noinit -shareon.min.css diff --git a/package.json b/package.json index 041167c..43a1b0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shareon", - "version": "1.3.0-5", + "version": "1.2.1", "description": "Lightweight, stylish and ethical share buttons for popular social networks", "license": "MIT", "homepage": "https://shareon.js.org", @@ -21,27 +21,15 @@ "email": "nick@karamoff.dev", "url": "https://karamoff.dev" }, - "main": "./index.js", - "module": "./index.mjs", - "unpkg": "./index.js", + "main": "./dist/shareon.cjs", + "module": "./dist/shareon.mjs", + "unpkg": "./dist/shareon.min.js", "exports": { - "./package.json": "./package.json", - ".": { - "browser": "./index.js", - "require": "./index.js", - "import": "./index.mjs" - }, - "./noinit": { - "browser": "./noinit/index.js", - "require": "./noinit/index.js", - "import": "./noinit/index.mjs" - } + "require": "./dist/shareon.cjs", + "import": "./dist/shareon.mjs" }, "files": [ - "index.js", - "index.mjs", - "noinit/index.js", - "noinit/index.mjs" + "dist" ], "scripts": { "build": "rollup -c", @@ -78,16 +66,18 @@ "size-limit": [ { "limit": "1 KB", - "path": "./index.js", + "path": "./dist/shareon.min.js", "webpack": false }, { "limit": "1 KB", - "path": "./index.mjs" + "path": [ + "./dist/shareon.cjs" + ] }, { "limit": "7 KB", - "path": "./shareon.min.css", + "path": "./dist/shareon.min.css", "webpack": false } ] diff --git a/rollup.config.js b/rollup.config.js index 4e3ffdc..253060e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,7 +10,7 @@ const isDev = process.env.ROLLUP_WATCH || process.env.NODE_ENV === 'development' const pkg = require('./package.json'); -const outputDir = isDev ? './dev/' : './'; +const outputDir = isDev ? './dev/' : './dist/'; const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov\n${pkg.homepage}`; @@ -67,32 +67,26 @@ const getOutputs = (baseDir) => { if (isDev) { result.push({ name: pkg.name, - format: 'umd', - file: `${baseDir}index.js`, + format: 'iife', + file: `${baseDir}${pkg.name}.js`, }); } else { - // result.push({ - // name: pkg.name, - // format: 'cjs', - // file: `${baseDir}index.cjs`, - // }); + result.push({ + name: pkg.name, + format: 'cjs', + file: `${baseDir}${pkg.name}.cjs`, + }); result.push({ name: pkg.name, format: 'esm', - file: `${baseDir}index.mjs`, + file: `${baseDir}${pkg.name}.mjs`, }); result.push({ name: pkg.name, - format: 'umd', - file: `${baseDir}index.js`, + format: 'iife', + file: `${baseDir}${pkg.name}.min.js`, plugins: [terser({ output: { comments: false } })], }); - // result.push({ - // name: pkg.name, - // format: 'iife', - // file: `${baseDir}index.min.js`, - // plugins: [terser({ output: { comments: false } })], - // }); } return result;