Merge pull request #15030 from Budibase/chore/cleanup-npm-package-config

Cleanup npm package config
This commit is contained in:
Adria Navarro 2024-11-19 12:26:48 +01:00 committed by GitHub
commit 7b5fbf3be0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 13 deletions

View File

@ -1,6 +1,4 @@
*
!dist/**/*
dist/tsconfig.build.tsbuildinfo
!package.json
!src/**
!tests/**
!package.json

View File

@ -9,6 +9,13 @@
"./tests": "./dist/tests/index.js",
"./*": "./dist/*.js"
},
"typesVersions": {
"*": {
"tests": [
"dist/tests/index.d.ts"
]
}
},
"author": "Budibase",
"license": "GPL-3.0",
"scripts": {

View File

@ -1,6 +1,7 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"lib": ["es2020", "dom"],
"composite": true,
"baseUrl": "."
},

View File

@ -0,0 +1,4 @@
*
!dist/**/*
dist/tsconfig.build.tsbuildinfo
!package.json

View File

@ -4,7 +4,7 @@
"description": "Handlebars wrapper for Budibase templating.",
"main": "dist/bundle.cjs",
"module": "dist/bundle.mjs",
"types": "src/index.ts",
"types": "dist/index.d.ts",
"license": "MPL-2.0",
"exports": {
".": {
@ -12,12 +12,8 @@
"import": "./dist/bundle.mjs"
},
"./package.json": "./package.json",
"./iife": "./src/iife.js"
"./iife": "./dist/iife.mjs"
},
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsc --emitDeclarationOnly && rollup -c",
"dev": "rollup -cw",

View File

@ -10,8 +10,8 @@ import inject from "@rollup/plugin-inject"
const production = !process.env.ROLLUP_WATCH
const config = (format, outputFile) => ({
input: "src/index.ts",
const config = (input, outputFile, format) => ({
input,
output: {
sourcemap: !production,
format,
@ -42,6 +42,7 @@ const config = (format, outputFile) => ({
})
export default [
config("cjs", "./dist/bundle.cjs"),
config("esm", "./dist/bundle.mjs"),
config("src/index.ts", "./dist/bundle.cjs", "cjs"),
config("src/index.ts", "./dist/bundle.mjs", "esm"),
config("src/iife.ts", "./dist/iife.mjs", "esm"),
]