diff --git a/.gitignore b/.gitignore index f198d42..68818c8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ yarn.lock wsEndpoint .output/ dist/ +lib/ +module/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..9c79abf --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +**/__tests__/** \ No newline at end of file diff --git a/package.json b/package.json index ea13c83..5d59221 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,22 @@ "name": "swagger-faker", "version": "0.6.0", "description": "Generate fake data from swagger", - "main": "dist/index.js", + "main": "lib/index.js", + "module": "module/index.js", "files": [ - "dist", + "lib", + "module", + "src", "README.md" ], "scripts": { "start": " ts-node examples/fakerGen.ts", "test": "jest", "build": "rm -rf dist/ && tsc", - "prepare": "npm run build && npm test" + "release": "npm run build:es5 && npm run build:es6", + "build:es5": "rm -rf lib && tsc --build ./tsconfig.build.es5.json", + "build:es6": "rm -rf module && tsc --build ./tsconfig.build.es6.json", + "prepare": "npm run release && npm test" }, "repository": { "type": "git", diff --git a/tsconfig.build.es5.json b/tsconfig.build.es5.json new file mode 100644 index 0000000..d1ebb49 --- /dev/null +++ b/tsconfig.build.es5.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "outDir": "lib" + } +} diff --git a/tsconfig.build.es6.json b/tsconfig.build.es6.json new file mode 100644 index 0000000..c7d94eb --- /dev/null +++ b/tsconfig.build.es6.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "es5", + "module": "es6", + "outDir": "module" + } +}