Skip to content

Commit

Permalink
🎨 Build as Node module
Browse files Browse the repository at this point in the history
  • Loading branch information
gluons committed May 24, 2017
1 parent 5f4a1fb commit b02b429
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.gitignore.io/api/node,linux,windows

# Dist files
dist/
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "."],
"showOutput": "silent",
"problemMatcher": "$tsc"
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
"name": "tslint-config-gluons",
"version": "1.0.2",
"description": "Gluons' personal TSLint shareable config.",
"main": "./index.ts",
"main": "./dist/index.js",
"files": [
"dist"
],
"scripts": {
"build": "tsc -p .",
"lint": "tslint -p . --type-check",
"prepublishOnly": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions index.ts → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import isProd from './utils/is-prod';

const config = require('./tslint.json');
const config = require('../tslint.json');

config.rules['no-console'] = [isProd()];
config.rules['no-debugger'] = isProd();

export default config;
export = config;
File renamed without changes.
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"strict": true,
"removeComments": true,
"outDir": "./dist"
},
"include": [
"./src/**/*.ts"
]
}

0 comments on commit b02b429

Please sign in to comment.