Rename shareon to index

pull/14/head
Nikita Karamov 2020-07-23 20:00:31 +02:00
parent bac84769e8
commit 59399f5a1c
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
4 changed files with 28 additions and 18 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
dev dev
dist dist
!dist/noinit/package.json
.DS_Store .DS_Store
.idea .idea
node_modules node_modules

7
dist/noinit/package.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"main": "index.cjs",
"module": "index.mjs",
"browser": {
"./index.js": "./index.min.js"
}
}

View File

@ -21,22 +21,26 @@
"email": "nick@karamoff.dev", "email": "nick@karamoff.dev",
"url": "https://karamoff.dev" "url": "https://karamoff.dev"
}, },
"main": "./dist/shareon.cjs", "main": "./dist/index.cjs",
"module": "./dist/shareon.mjs", "module": "./dist/index.mjs",
"unpkg": "./dist/shareon.min.js", "unpkg": "./dist/index.min.js",
"exports": { "exports": {
"./package.json": "./package.json", "./package.json": "./package.json",
".": { ".": {
"browser": "./dist/shareon.min.js", "browser": "./dist/index.min.js",
"require": "./dist/shareon.cjs", "require": "./dist/index.cjs",
"import": "./dist/shareon.mjs" "import": "./dist/index.mjs"
}, },
"./noinit/package.json": "./dist/noinit/package.json",
"./noinit": { "./noinit": {
"browser": "./dist/noinit/shareon.min.js", "browser": "./dist/noinit/index.min.js",
"require": "./dist/noinit/shareon.cjs", "require": "./dist/noinit/index.cjs",
"import": "./dist/noinit/shareon.mjs" "import": "./dist/noinit/index.mjs"
} }
}, },
"browser": {
"./index.js": "./dist/index.min.js"
},
"files": [ "files": [
"dist" "dist"
], ],
@ -75,18 +79,16 @@
"size-limit": [ "size-limit": [
{ {
"limit": "1 KB", "limit": "1 KB",
"path": "./dist/shareon.min.js", "path": "./dist/index.min.js",
"webpack": false "webpack": false
}, },
{ {
"limit": "1 KB", "limit": "1 KB",
"path": [ "path": "./dist/index.mjs"
"./dist/shareon.cjs"
]
}, },
{ {
"limit": "7 KB", "limit": "7 KB",
"path": "./dist/shareon.min.css", "path": "./dist/index.min.css",
"webpack": false "webpack": false
} }
] ]

View File

@ -68,23 +68,23 @@ const getOutputs = (baseDir) => {
result.push({ result.push({
name: pkg.name, name: pkg.name,
format: 'iife', format: 'iife',
file: `${baseDir}${pkg.name}.js`, file: `${baseDir}index.js`,
}); });
} else { } else {
result.push({ result.push({
name: pkg.name, name: pkg.name,
format: 'cjs', format: 'cjs',
file: `${baseDir}${pkg.name}.cjs`, file: `${baseDir}index.cjs`,
}); });
result.push({ result.push({
name: pkg.name, name: pkg.name,
format: 'esm', format: 'esm',
file: `${baseDir}${pkg.name}.mjs`, file: `${baseDir}index.mjs`,
}); });
result.push({ result.push({
name: pkg.name, name: pkg.name,
format: 'iife', format: 'iife',
file: `${baseDir}${pkg.name}.min.js`, file: `${baseDir}index.min.js`,
plugins: [terser({ output: { comments: false } })], plugins: [terser({ output: { comments: false } })],
}); });
} }