Revert previous changes

pull/14/head
Nikita Karamov 2020-07-26 14:17:16 +02:00
parent 7132702f57
commit 51c294b471
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
3 changed files with 24 additions and 44 deletions

6
.gitignore vendored
View File

@ -1,9 +1,5 @@
dev
.DS_Store
dist
.idea
node_modules
yarn-error.log
index.js
index.mjs
noinit
shareon.min.css

View File

@ -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
}
]

View File

@ -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;