Use rollup for redux-devtools-utils

This commit is contained in:
Nathan Bierema 2022-01-09 16:38:17 -05:00
parent 0107b97dea
commit f4558a4748
6 changed files with 74 additions and 18 deletions

View File

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

View File

@ -1 +1 @@
lib
dist

View File

@ -1,7 +1,13 @@
module.exports = {
extends: '../../eslintrc.ts.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: '../../eslintrc.js.base.json',
overrides: [
{
files: ['*.ts'],
extends: '../../eslintrc.ts.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
},
],
};

View File

@ -9,27 +9,26 @@
"license": "MIT",
"author": "Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)",
"files": [
"src",
"lib",
"umd"
"dist",
"src"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "dist/redux-devtools-utils.cjs.js",
"module": "dist/redux-devtools-utils.esm.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn run build:types && yarn run build:js",
"build:types": "tsc --emitDeclarationOnly",
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
"clean": "rimraf lib",
"build": "rollup -c",
"clean": "rimraf dist",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
},
"dependencies": {
"@babel/runtime": "^7.16.7",
"@redux-devtools/core": "^3.9.2",
"@redux-devtools/serialize": "^0.3.2",
"@types/get-params": "^0.1.0",
@ -41,10 +40,12 @@
"redux": "^4.1.2"
},
"devDependencies": {
"@babel/cli": "^7.16.7",
"@babel/core": "^7.16.7",
"@babel/eslint-parser": "^7.16.5",
"@babel/plugin-transform-runtime": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@rollup/plugin-babel": "^5.3.0",
"@types/jsan": "^3.1.2",
"@types/lodash": "^4.14.178",
"@types/node": "^16.11.17",
@ -53,6 +54,9 @@
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.63.0",
"rollup-plugin-typescript2": "^0.31.1",
"tslib": "^2.3.1",
"typescript": "~4.5.4"
},
"peerDependencies": {

View File

@ -0,0 +1,36 @@
import typescript from 'rollup-plugin-typescript2';
import babel from '@rollup/plugin-babel';
const config = [
{
input: 'src/index.ts',
output: [
{
file: 'dist/redux-devtools-serialize.cjs.js',
format: 'cjs',
},
{
file: 'dist/redux-devtools-serialize.esm.js',
format: 'esm',
},
],
plugins: [
typescript(),
babel({
babelHelpers: 'runtime',
extensions: ['.ts'],
plugins: ['@babel/plugin-transform-runtime'],
}),
],
external: [
/@babel\/runtime/,
'get-params',
'jsan',
/nanoid/,
'@redux-devtools/serialize',
/lodash/,
],
},
];
export default config;

View File

@ -5303,12 +5303,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@redux-devtools/utils@workspace:packages/redux-devtools-utils"
dependencies:
"@babel/cli": ^7.16.7
"@babel/core": ^7.16.7
"@babel/eslint-parser": ^7.16.5
"@babel/plugin-transform-runtime": ^7.16.7
"@babel/preset-env": ^7.16.7
"@babel/preset-typescript": ^7.16.7
"@babel/runtime": ^7.16.7
"@redux-devtools/core": ^3.9.2
"@redux-devtools/serialize": ^0.3.2
"@rollup/plugin-babel": ^5.3.0
"@types/get-params": ^0.1.0
"@types/jsan": ^3.1.2
"@types/lodash": ^4.14.178
@ -5324,6 +5327,9 @@ __metadata:
nanoid: ^3.1.30
redux: ^4.1.2
rimraf: ^3.0.2
rollup: ^2.63.0
rollup-plugin-typescript2: ^0.31.1
tslib: ^2.3.1
typescript: ~4.5.4
peerDependencies:
"@redux-devtools/core": ^3.7.0