mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-23 14:39:58 +03:00
Use rollup for map2tree
This commit is contained in:
parent
59005df549
commit
98caecd5cc
|
@ -1,3 +1 @@
|
||||||
examples
|
|
||||||
lib
|
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -59,7 +59,7 @@ const config = [
|
||||||
plugins: ['@babel/plugin-transform-runtime'],
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
external: ['ramda', /@babel\/runtime/],
|
external: [/@babel\/runtime/, 'ramda'],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
{
|
{
|
||||||
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
"targets": "defaults"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/preset-typescript"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
examples
|
|
||||||
lib
|
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts'],
|
||||||
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./test/tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['test/**/*.ts'],
|
files: ['test/**/*.ts'],
|
||||||
extends: '../../eslintrc.ts.jest.base.json',
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
@ -13,13 +17,5 @@ module.exports = {
|
||||||
project: ['./test/tsconfig.json'],
|
project: ['./test/tsconfig.json'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: ['webpack.config.umd.ts'],
|
|
||||||
extends: '../../eslintrc.ts.base.json',
|
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.webpack.json'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,18 +20,16 @@
|
||||||
"dist",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/map2tree.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/map2tree.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"unpkg": "dist/map2tree.umd.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/reduxjs/redux-devtools.git"
|
"url": "https://github.com/reduxjs/redux-devtools.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn run build:types && yarn run build:js && yarn run build:umd && yarn run build:umd:min",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
|
|
||||||
"build:umd": "webpack --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"clean": "rimraf lib dist",
|
"clean": "rimraf lib dist",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
|
@ -40,27 +38,33 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.16.7",
|
|
||||||
"@babel/core": "^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-env": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"@types/node": "^16.11.17",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"babel-loader": "^8.2.3",
|
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-jest": "^25.3.4",
|
"eslint-plugin-jest": "^25.3.4",
|
||||||
"immutable": "^4.0.0",
|
"immutable": "^4.0.0",
|
||||||
"jest": "^27.4.5",
|
"jest": "^27.4.5",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
"ts-node": "^10.4.0",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4",
|
"typescript": "~4.5.4",
|
||||||
"webpack": "^5.65.0",
|
"webpack": "^5.65.0",
|
||||||
"webpack-cli": "^4.9.1"
|
"webpack-cli": "^4.9.1"
|
||||||
|
|
66
packages/map2tree/rollup.config.js
Normal file
66
packages/map2tree/rollup.config.js
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'map2tree',
|
||||||
|
file: 'dist/map2tree.umd.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'map2tree',
|
||||||
|
file: 'dist/map2tree.umd.min.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/map2tree.cjs.js', format: 'cjs', exports: 'auto' },
|
||||||
|
{ file: 'dist/map2tree.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [/@babel\/runtime/, /lodash/],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"include": ["webpack.config.umd.ts"]
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
import * as path from 'path';
|
|
||||||
import * as webpack from 'webpack';
|
|
||||||
|
|
||||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
||||||
mode: env.production ? 'production' : 'development',
|
|
||||||
entry: {
|
|
||||||
app: ['./src/index'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: 'map2tree',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: env.production ? 'map2tree.min.js' : 'map2tree.js',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|ts)$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
||||||
},
|
|
||||||
});
|
|
14
yarn.lock
14
yarn.lock
|
@ -20066,16 +20066,19 @@ __metadata:
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "map2tree@workspace:packages/map2tree"
|
resolution: "map2tree@workspace:packages/map2tree"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/cli": ^7.16.7
|
|
||||||
"@babel/core": ^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-env": ^7.16.7
|
||||||
"@babel/preset-typescript": ^7.16.7
|
"@babel/preset-typescript": ^7.16.7
|
||||||
|
"@babel/runtime": ^7.16.7
|
||||||
|
"@rollup/plugin-babel": ^5.3.0
|
||||||
|
"@rollup/plugin-commonjs": ^21.0.1
|
||||||
|
"@rollup/plugin-node-resolve": ^13.1.3
|
||||||
"@types/jest": ^27.4.0
|
"@types/jest": ^27.4.0
|
||||||
"@types/lodash": ^4.14.178
|
"@types/lodash": ^4.14.178
|
||||||
"@types/node": ^16.11.17
|
|
||||||
"@typescript-eslint/eslint-plugin": ^5.8.1
|
"@typescript-eslint/eslint-plugin": ^5.8.1
|
||||||
"@typescript-eslint/parser": ^5.8.1
|
"@typescript-eslint/parser": ^5.8.1
|
||||||
babel-loader: ^8.2.3
|
|
||||||
eslint: ^8.6.0
|
eslint: ^8.6.0
|
||||||
eslint-config-prettier: ^8.3.0
|
eslint-config-prettier: ^8.3.0
|
||||||
eslint-plugin-jest: ^25.3.4
|
eslint-plugin-jest: ^25.3.4
|
||||||
|
@ -20083,8 +20086,11 @@ __metadata:
|
||||||
jest: ^27.4.5
|
jest: ^27.4.5
|
||||||
lodash: ^4.17.21
|
lodash: ^4.17.21
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
|
rollup: ^2.63.0
|
||||||
|
rollup-plugin-terser: ^7.0.2
|
||||||
|
rollup-plugin-typescript2: ^0.31.1
|
||||||
ts-jest: ^27.1.2
|
ts-jest: ^27.1.2
|
||||||
ts-node: ^10.4.0
|
tslib: ^2.3.1
|
||||||
typescript: ~4.5.4
|
typescript: ~4.5.4
|
||||||
webpack: ^5.65.0
|
webpack: ^5.65.0
|
||||||
webpack-cli: ^4.9.1
|
webpack-cli: ^4.9.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user