Move files outside the dist folder

pull/14/head
Nikita Karamov 2020-07-23 20:17:00 +02:00
parent f868a8fd3f
commit 88f92e7026
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
4 changed files with 35 additions and 35 deletions

6
.gitignore vendored
View File

@ -1,7 +1,9 @@
dev
dist
!dist/noinit/package.json
.DS_Store
.idea
node_modules
yarn-error.log
index.js
index.mjs
noinit
shareon.min.css

View File

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

View File

@ -21,28 +21,27 @@
"email": "nick@karamoff.dev",
"url": "https://karamoff.dev"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"unpkg": "./dist/index.min.js",
"main": "./index.js",
"module": "./index.mjs",
"unpkg": "./index.js",
"exports": {
"./package.json": "./package.json",
".": {
"browser": "./dist/index.min.js",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"browser": "./index.js",
"require": "./index.js",
"import": "./index.mjs"
},
"./noinit/package.json": "./dist/noinit/package.json",
"./noinit": {
"browser": "./dist/noinit/index.min.js",
"require": "./dist/noinit/index.cjs",
"import": "./dist/noinit/index.mjs"
"browser": "./noinit/index.js",
"require": "./noinit/index.js",
"import": "./noinit/index.mjs"
}
},
"browser": {
"./index.js": "./dist/index.min.js"
},
"files": [
"dist"
"index.js",
"index.mjs",
"noinit/index.js",
"noinit/index.mjs"
],
"scripts": {
"build": "rollup -c",
@ -79,16 +78,16 @@
"size-limit": [
{
"limit": "1 KB",
"path": "./dist/index.min.js",
"path": "./index.js",
"webpack": false
},
{
"limit": "1 KB",
"path": "./dist/index.mjs"
"path": "./index.mjs"
},
{
"limit": "7 KB",
"path": "./dist/index.min.css",
"path": "./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/' : './dist/';
const outputDir = isDev ? './dev/' : './';
const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov\n${pkg.homepage}`;
@ -67,15 +67,15 @@ const getOutputs = (baseDir) => {
if (isDev) {
result.push({
name: pkg.name,
format: 'iife',
format: 'umd',
file: `${baseDir}index.js`,
});
} else {
result.push({
name: pkg.name,
format: 'cjs',
file: `${baseDir}index.cjs`,
});
// result.push({
// name: pkg.name,
// format: 'cjs',
// file: `${baseDir}index.cjs`,
// });
result.push({
name: pkg.name,
format: 'esm',
@ -83,10 +83,16 @@ const getOutputs = (baseDir) => {
});
result.push({
name: pkg.name,
format: 'iife',
file: `${baseDir}index.min.js`,
format: 'umd',
file: `${baseDir}index.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;