Skip to content

Commit

Permalink
Merge pull request #107 from mizdra/use-commonjs-in-example
Browse files Browse the repository at this point in the history
Use commonjs in example
  • Loading branch information
mizdra authored Sep 4, 2022
2 parents 9b311f2 + d21edd9 commit 22d6ba5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "example",
"version": "1.0.0",
"description": "",
"type": "module",
"type": "commonjs",
"main": "app.js",
"scripts": {
"etcm": "../bin/etcm.js '**/*.{css,scss,less}'"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"lint:tsc": "run-s -c lint:tsc:*",
"lint:tsc:src": "tsc -p tsconfig.src.json --noEmit",
"lint:tsc:test": "tsc -p tsconfig.test.json --noEmit",
"lint:tsc:example": "tsc -p tsconfig.example.json --noEmit",
"test": "NODE_OPTIONS=\"--experimental-vm-modules $NODE_OPTIONS\" jest"
},
"bin": {
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.base.json",
"include": ["example/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"module": "CommonJS",
// Compatible for Node.js v12 (ref: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping)
"target": "ES2019",
"lib": ["ES2019"]
}
}
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
// ref: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#support-for-solution-style-tsconfigjson-files
{
"files": [],
"references": [{ "path": "./tsconfig.src.json" }, { "path": "./tsconfig.test.json" }]
"references": [
{ "path": "./tsconfig.src.json" },
{ "path": "./tsconfig.test.json" },
{ "path": "./tsconfig.example.json" }
]
}

0 comments on commit 22d6ba5

Please sign in to comment.