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
dist
!dist/noinit/package.json
.DS_Store
.idea
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",
"url": "https://karamoff.dev"
},
"main": "./dist/shareon.cjs",
"module": "./dist/shareon.mjs",
"unpkg": "./dist/shareon.min.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"unpkg": "./dist/index.min.js",
"exports": {
"./package.json": "./package.json",
".": {
"browser": "./dist/shareon.min.js",
"require": "./dist/shareon.cjs",
"import": "./dist/shareon.mjs"
"browser": "./dist/index.min.js",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
},
"./noinit/package.json": "./dist/noinit/package.json",
"./noinit": {
"browser": "./dist/noinit/shareon.min.js",
"require": "./dist/noinit/shareon.cjs",
"import": "./dist/noinit/shareon.mjs"
"browser": "./dist/noinit/index.min.js",
"require": "./dist/noinit/index.cjs",
"import": "./dist/noinit/index.mjs"
}
},
"browser": {
"./index.js": "./dist/index.min.js"
},
"files": [
"dist"
],
@ -75,18 +79,16 @@
"size-limit": [
{
"limit": "1 KB",
"path": "./dist/shareon.min.js",
"path": "./dist/index.min.js",
"webpack": false
},
{
"limit": "1 KB",
"path": [
"./dist/shareon.cjs"
]
"path": "./dist/index.mjs"
},
{
"limit": "7 KB",
"path": "./dist/shareon.min.css",
"path": "./dist/index.min.css",
"webpack": false
}
]

View File

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