This commit is contained in:
Nathan Bierema 2022-01-23 15:42:24 -05:00
parent 3fdc335e16
commit 378f3f90a1
7 changed files with 31 additions and 29 deletions

View File

@ -1 +1 @@
dist
lib

View File

@ -0,0 +1,7 @@
{
"presets": [
["@babel/preset-env", { "targets": "defaults", "modules": false }],
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}

View File

View File

@ -16,20 +16,25 @@
"license": "MIT",
"author": "romseguy",
"files": [
"dist",
"lib",
"src"
],
"main": "dist/map2tree.cjs.js",
"module": "dist/map2tree.esm.js",
"types": "dist/index.d.ts",
"unpkg": "dist/map2tree.umd.js",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"unpkg": "lib/umd/map2tree.umd.js",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "rollup -c",
"clean": "rimraf dist",
"build": "yarn build:cjs && yarn build:esm && yarn build:types && yarn build:umd",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"build:umd": "rollup -c",
"clean": "rimraf lib",
"test": "jest",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
@ -41,6 +46,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@babel/cli": "^7.16.8",
"@babel/core": "^7.16.12",
"@babel/eslint-parser": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.10",

View File

@ -9,11 +9,13 @@ const config = [
input: 'src/index.ts',
output: {
name: 'map2tree',
file: 'dist/map2tree.umd.js',
file: 'lib/umd/map2tree.js',
format: 'umd',
},
plugins: [
typescript(),
typescript({
tsconfigOverride: { compilerOptions: { declaration: false } },
}),
resolve(),
commonjs(),
babel({
@ -27,11 +29,13 @@ const config = [
input: 'src/index.ts',
output: {
name: 'map2tree',
file: 'dist/map2tree.umd.min.js',
file: 'lib/umd/map2tree.min.js',
format: 'umd',
},
plugins: [
typescript(),
typescript({
tsconfigOverride: { compilerOptions: { declaration: false } },
}),
resolve(),
commonjs(),
babel({
@ -42,22 +46,6 @@ const config = [
terser(),
],
},
{
input: 'src/index.ts',
output: [
{ file: 'dist/map2tree.cjs.js', format: 'cjs' },
{ file: 'dist/map2tree.esm.js', format: 'esm' },
],
plugins: [
typescript(),
babel({
babelHelpers: 'runtime',
extensions: ['.ts'],
plugins: ['@babel/plugin-transform-runtime'],
}),
],
external: [/@babel\/runtime/, /lodash/],
},
];
export default config;

View File

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.react.base.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib/types"
},
"include": ["src"]
}

View File

@ -20071,6 +20071,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "map2tree@workspace:packages/map2tree"
dependencies:
"@babel/cli": ^7.16.8
"@babel/core": ^7.16.12
"@babel/eslint-parser": ^7.16.5
"@babel/plugin-transform-runtime": ^7.16.10