diff --git a/.gitignore b/.gitignore index 6ebefae94c..76bcabfe9d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ ng2-bootstrap.js ng2-bootstrap.d.ts ng2-bootstrap.js.map /logs + +# npm package source +/ts diff --git a/.npmignore b/.npmignore index 1755dc1f50..b8b3c22661 100644 --- a/.npmignore +++ b/.npmignore @@ -15,3 +15,7 @@ coverage demo demo-build webpack.config.js + +# source typescript +ng2-bootstrap.ts +components/**/*.ts diff --git a/package.json b/package.json index 6f3b7d152a..55acc3c4ad 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "angular2 bootstrap components", "scripts": { "compile": "./node_modules/.bin/tsc", - "prepublish": "./node_modules/.bin/tsc && ./make.js", + "prepublish": "./node_modules/.bin/tsc && ./make.js && node ./pre-publish-npm.js", "publish:gh-pages": "./gh-pages-publish.js", "postpublish": "npm run build:prod && npm run publish:gh-pages", "build:prod": "NODE_ENV=production ./node_modules/.bin/webpack --progress --color", @@ -46,6 +46,7 @@ "bootstrap": "3.3.6", "compression-webpack-plugin": "0.2.0", "copy-webpack-plugin": "1.1.1", + "cpy": "^4.0.0", "del": "2.2.0", "es6-promise": "3.0.2", "es6-shim": "0.33.3", diff --git a/pre-publish-npm.js b/pre-publish-npm.js new file mode 100644 index 0000000000..78571598ad --- /dev/null +++ b/pre-publish-npm.js @@ -0,0 +1,14 @@ +#!/usr/bin/env node +/*eslint no-console: 0, no-sync: 0*/ +'use strict'; + +var cpy = require('cpy'); + +var tsSource = [ + '**/*.ts', + '!**/*.d.ts', + '!node_modules/**/*.ts', + '!demo/**/*.ts' +]; + +cpy(tsSource, 'ts', {parents: true});