Skip to content

Commit 5883611

Browse files
committed
fix: common JS default export
1 parent 1d61abf commit 5883611

File tree

5 files changed

+59
-7
lines changed

5 files changed

+59
-7
lines changed

package-lock.json

Lines changed: 45 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
],
1717
"scripts": {
1818
"build": "run-p build:*",
19-
"build:main": "tsc -p tsconfig.json",
20-
"build:module": "tsc -p tsconfig.module.json",
19+
"build:main": "ttsc -p tsconfig.json",
20+
"build:module": "ttsc -p tsconfig.module.json",
2121
"fix": "run-s fix:*",
2222
"fix:prettier": "prettier \"src/**/*.ts\" --write",
2323
"fix:lint": "eslint src --ext .ts --fix",
@@ -29,7 +29,7 @@
2929
"check-cli": "run-s test diff-integration-tests check-integration-tests",
3030
"check-integration-tests": "run-s check-integration-test:*",
3131
"diff-integration-tests": "mkdir -p diff && rm -rf diff/test && cp -r test diff/test && rm -rf diff/test/test-*/.git && cd diff && git init --quiet && git add -A && git commit --quiet --no-verify --allow-empty -m 'WIP' && echo '\\n\\nCommitted most recent integration test output in the \"diff\" directory. Review the changes with \"cd diff && git diff HEAD\" or your preferred git diff viewer.'",
32-
"watch:build": "tsc -p tsconfig.json -w",
32+
"watch:build": "ttsc -p tsconfig.json -w",
3333
"watch:test": "nyc --silent ava --watch",
3434
"cov": "run-s build test:unit cov:html cov:lcov && open-cli coverage/index.html",
3535
"cov:html": "nyc report --reporter=html",
@@ -77,6 +77,8 @@
7777
"standard-version": "^9.0.0",
7878
"tailwindcss": "^2.0.3",
7979
"ts-node": "^9.0.0",
80+
"ts-transform-default-export": "^1.0.3",
81+
"ttypescript": "^1.5.12",
8082
"typedoc": "^0.19.0",
8183
"typescript": "^4.0.2"
8284
},

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import selectorParser, { Node } from 'postcss-selector-parser';
22
import plugin from 'tailwindcss/plugin';
33

4-
export default plugin(({ theme, addVariant, prefix, e: escape }) => {
4+
const nestedGroupPlugin = plugin(({ theme, addVariant, prefix, e: escape }) => {
55
const groupLevel = theme('groupLevel') || 10;
66
const groupScope = theme('groupScope') || 'scope';
77
const groupVariants = theme('groupVariants') || ['hover', 'focus'];
@@ -49,3 +49,5 @@ export default plugin(({ theme, addVariant, prefix, e: escape }) => {
4949
});
5050
});
5151
});
52+
53+
export default nestedGroupPlugin;

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
"skipLibCheck": true,
4141
"lib": ["es2017"],
4242
"types": ["node"],
43-
"typeRoots": ["node_modules/@types", "src/types"]
43+
"typeRoots": ["node_modules/@types", "src/types"],
44+
"plugins": [{
45+
"transform": "ts-transform-default-export",
46+
}]
4447
},
4548
"include": ["src/**/*.ts"],
4649
"exclude": ["node_modules/**"],

tsconfig.module.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"target": "esnext",
55
"outDir": "build/module",
6-
"module": "esnext"
6+
"module": "esnext",
7+
"plugins": []
78
},
89
"exclude": [
910
"node_modules/**"

0 commit comments

Comments
 (0)