Compare commits

...

4 Commits

4 changed files with 39 additions and 5 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/dist/
/node_modules/
/package-lock.json
/pnpm-lock.yaml
/shrinkwrap.yaml
/yarn.lock

View File

@ -1,3 +1,7 @@
# v2.2.0
- Expose proper ESM build (along with CJS build) using `pkg.exports` map
# v2.1.1
- Fix published types for `defiler.add(file)`

View File

@ -1,6 +1,6 @@
{
"name": "defiler",
"version": "2.1.1",
"version": "2.2.0",
"description": "A small, strange building block",
"keywords": [
"build",
@ -8,12 +8,19 @@
"async",
"watch"
],
"type": "module",
"main": "src/index.js",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "types/index.d.ts",
"files": [
"*.md",
"src",
"dist",
"types"
],
"engines": {
@ -28,5 +35,14 @@
"bugs": {
"url": "https://github.com/Conduitry/defiler/issues"
},
"homepage": "https://conduitry.dev/defiler"
"homepage": "https://conduitry.dev/defiler",
"devDependencies": {
"@types/node": "=12",
"rollup": "^2"
},
"scripts": {
"build": "rollup -c",
"dev": "rollup -cw",
"prepare": "npm run build"
}
}

8
rollup.config.js Normal file
View File

@ -0,0 +1,8 @@
export default {
input: './src/index.js',
external: name => /^[a-z]/.test(name),
output: [
{ file: './dist/index.cjs', format: 'cjs', sourcemap: true, interop: false, preferConst: true },
{ file: './dist/index.mjs', format: 'esm', sourcemap: true, preferConst: true },
],
};