Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.replace.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
files: 'index.d.ts',
from: /declare namespace[^}]*\}[^}]*\};/g,
to: '\nexport = postcssRTLCSS',
to: 'export = postcssRTLCSS',
};
3 changes: 0 additions & 3 deletions package.esm.json

This file was deleted.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@
"lint": "eslint src/**/*.ts",
"clean": "./scripts/clean.sh",
"copy": "./scripts/copy.sh",
"build-dts": "rollup --config rollup.dts.config.js",
"modify-dts": "replace-in-file --configFile=config.replace.js",
"build": "yarn clean && rollup --config rollup.config.js && yarn copy && yarn build-dts && yarn modify-dts",
"prepare": "yarn build && yarn copy",
"build": "yarn clean && rollup --config rollup.config.js && yarn copy && yarn modify-dts",
"prepare": "yarn build",
"prepublishOnly": "npm run lint && npm run test",
"version": "git add .",
"postversion": "git push && git push --tags"
Expand All @@ -57,7 +56,6 @@
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-typescript": "^8.3.1",
"@types/eslint": "^8.2.2",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.10",
Expand All @@ -71,11 +69,9 @@
"postcss": "^8.3.11",
"replace-in-file": "^6.3.2",
"rollup": "^2.70.1",
"rollup-plugin-dts": "^4.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^2.0.5",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.6",
"tslib": "^2.3.1",
"typescript": "4.4.4"
},
"peerDependencies": {
Expand Down
15 changes: 4 additions & 11 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import ts from 'rollup-plugin-ts';
import { terser } from "rollup-plugin-terser";

const getPlugins = (includeJson) => {
const plugins = includeJson
? [
json()
]
? [ json() ]
: [];
return [
...plugins,
typescript({
tsconfig: './tsconfig.json',
declaration: true,
outDir: './'
}),
ts(),
terser({
output: {
comments: false
Expand All @@ -37,8 +31,7 @@ const getConfig = (name, defaults = true) => ({
},
{
file: `dist/esm/${name}.js`,
format: 'es',
exports: defaults ? 'default' : 'named'
format: 'es'
}
]
});
Expand Down
24 changes: 0 additions & 24 deletions rollup.dts.config.js

This file was deleted.

10 changes: 7 additions & 3 deletions scripts/copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ mkdir esm
cp dist/index.js index.js
cp dist/esm/index.js esm/index.js

# options
## options
cp dist/options.js options.js
cp dist/esm/options.js esm/options.js

# esm package
cp package.esm.json esm/package.json
## type definitions
cp dist/index.d.ts index.d.ts
cp dist/options.d.ts options.d.ts

## esm package
echo '{\n "type": "module"\n}' > esm/package.json
Loading