diff --git a/packages/react-base16-styling/.eslintignore b/packages/react-base16-styling/.eslintignore index 1521c8b7..a65b4177 100644 --- a/packages/react-base16-styling/.eslintignore +++ b/packages/react-base16-styling/.eslintignore @@ -1 +1 @@ -dist +lib diff --git a/packages/react-base16-styling/babel.config.esm.json b/packages/react-base16-styling/babel.config.esm.json new file mode 100644 index 00000000..1c02687e --- /dev/null +++ b/packages/react-base16-styling/babel.config.esm.json @@ -0,0 +1,7 @@ +{ + "presets": [ + ["@babel/preset-env", { "targets": "defaults", "modules": false }], + "@babel/preset-typescript" + ], + "plugins": ["@babel/plugin-transform-runtime"] +} diff --git a/packages/react-base16-styling/.babelrc b/packages/react-base16-styling/babel.config.json similarity index 100% rename from packages/react-base16-styling/.babelrc rename to packages/react-base16-styling/babel.config.json diff --git a/packages/react-base16-styling/package.json b/packages/react-base16-styling/package.json index 94910a7e..8ffd17b7 100644 --- a/packages/react-base16-styling/package.json +++ b/packages/react-base16-styling/package.json @@ -15,19 +15,23 @@ "license": "MIT", "author": "Alexander (http://kuzya.org/)", "files": [ - "dist", + "lib", "src" ], - "main": "dist/react-base16-styling.cjs.js", - "module": "dist/react-base16-styling.esm.js", - "types": "dist/index.d.ts", + "main": "lib/cjs/index.js", + "module": "lib/esm/index.js", + "types": "lib/types/index.d.ts", + "sideEffects": false, "repository": { "type": "git", "url": "git+https://github.com/reduxjs/redux-devtools.git" }, "scripts": { - "build": "rollup -c", - "clean": "rimraf dist", + "build": "yarn build:cjs && yarn build:esm && yarn build:types", + "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", + "clean": "rimraf lib", "test": "jest", "lint": "eslint . --ext .ts", "type-check": "tsc --noEmit", @@ -44,12 +48,12 @@ "lodash.curry": "^4.1.1" }, "devDependencies": { + "@babel/cli": "^7.16.8", "@babel/core": "^7.16.12", "@babel/eslint-parser": "^7.16.5", "@babel/plugin-transform-runtime": "^7.16.10", "@babel/preset-env": "^7.16.11", "@babel/preset-typescript": "^7.16.7", - "@rollup/plugin-babel": "^5.3.0", "@types/color": "^3.0.2", "@types/jest": "^27.4.0", "@types/lodash.curry": "^4.1.6", @@ -60,10 +64,7 @@ "eslint-plugin-jest": "^25.7.0", "jest": "^27.4.7", "rimraf": "^3.0.2", - "rollup": "^2.66.0", - "rollup-plugin-typescript2": "^0.31.1", "ts-jest": "^27.1.3", - "tslib": "^2.3.1", "typescript": "~4.5.5" } } diff --git a/packages/react-base16-styling/rollup.config.js b/packages/react-base16-styling/rollup.config.js deleted file mode 100644 index 0002d276..00000000 --- a/packages/react-base16-styling/rollup.config.js +++ /dev/null @@ -1,23 +0,0 @@ -import typescript from 'rollup-plugin-typescript2'; -import babel from '@rollup/plugin-babel'; - -const config = [ - { - input: 'src/index.ts', - output: [ - { file: 'dist/react-base16-styling.cjs.js', format: 'cjs' }, - { file: 'dist/react-base16-styling.esm.js', format: 'esm' }, - ], - plugins: [ - typescript(), - babel({ - babelHelpers: 'runtime', - extensions: ['.ts'], - plugins: ['@babel/plugin-transform-runtime'], - }), - ], - external: [/@babel\/runtime/, 'base16', 'color', 'lodash.curry'], - }, -]; - -export default config; diff --git a/packages/react-base16-styling/tsconfig.json b/packages/react-base16-styling/tsconfig.json index 84575cb5..19e4e718 100644 --- a/packages/react-base16-styling/tsconfig.json +++ b/packages/react-base16-styling/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "lib" + "outDir": "lib/types" }, "include": ["src"] } diff --git a/yarn.lock b/yarn.lock index ee869086..adf859a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23859,13 +23859,13 @@ __metadata: version: 0.0.0-use.local resolution: "react-base16-styling@workspace:packages/react-base16-styling" dependencies: + "@babel/cli": ^7.16.8 "@babel/core": ^7.16.12 "@babel/eslint-parser": ^7.16.5 "@babel/plugin-transform-runtime": ^7.16.10 "@babel/preset-env": ^7.16.11 "@babel/preset-typescript": ^7.16.7 "@babel/runtime": ^7.16.7 - "@rollup/plugin-babel": ^5.3.0 "@types/base16": ^1.0.2 "@types/color": ^3.0.2 "@types/jest": ^27.4.0 @@ -23882,10 +23882,7 @@ __metadata: jest: ^27.4.7 lodash.curry: ^4.1.1 rimraf: ^3.0.2 - rollup: ^2.66.0 - rollup-plugin-typescript2: ^0.31.1 ts-jest: ^27.1.3 - tslib: ^2.3.1 typescript: ~4.5.5 languageName: unknown linkType: soft