mirror of
https://github.com/jwetzell/acn-js.git
synced 2026-08-22 06:38:58 +00:00
Merge pull request #6 from jwetzell/feat/typescript-building-work
add esm and cjs builds
This commit is contained in:
@@ -2,11 +2,22 @@
|
|||||||
"name": "@jwetzell/acn",
|
"name": "@jwetzell/acn",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "./dist/cjs/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"module": "./dist/esm/index.js",
|
||||||
|
"types": "./dist/types/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/esm/index.js",
|
||||||
|
"require": "./dist/cjs/index.js",
|
||||||
|
"types": "./dist/types/index.d.ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rimraf dist",
|
"prebuild": "rimraf dist",
|
||||||
"build": "tsc",
|
"build": "npm run build:cjs && npm run build:esm && npm run build:types",
|
||||||
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
||||||
|
"build:esm": "tsc -p tsconfig.esm.json",
|
||||||
|
"build:types": "tsc -p tsconfig.types.json",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"test": "node --test --experimental-test-coverage"
|
"test": "node --test --experimental-test-coverage"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { deepEqual, throws } = require('assert');
|
const { deepEqual, throws } = require('assert');
|
||||||
const { describe, it } = require('node:test');
|
const { describe, it } = require('node:test');
|
||||||
const acn = require('../dist/index');
|
const acn = require('../dist/cjs/index');
|
||||||
|
|
||||||
const goodTests = [
|
const goodTests = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "CommonJS",
|
||||||
|
"declaration": false,
|
||||||
|
"outDir": "./dist/cjs"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "ESNext",
|
||||||
|
"declaration": false,
|
||||||
|
"outDir": "./dist/esm"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"moduleResolution": "Node",
|
||||||
|
"lib": ["ESNext"],
|
||||||
|
"target": "ESNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"module": "commonjs",
|
"isolatedModules": true,
|
||||||
"target": "ES2020",
|
"rootDir": "src/",
|
||||||
"declaration": true,
|
"strict": true
|
||||||
"rootDir": "./src",
|
|
||||||
"strict": true,
|
|
||||||
"outDir": "dist"
|
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "dist", "examples"]
|
"include": ["src/"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"outDir": "./dist/types"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user