From b36db5a8276669904ad82d16c8641235cc84d6b1 Mon Sep 17 00:00:00 2001 From: Mike Klemarewski Date: Wed, 24 Feb 2016 14:06:02 -0800 Subject: [PATCH 1/2] Build jsx -> js on pre-publish --- .gitignore | 1 + .npmignore | 1 + package.json | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore index c2658d7..96b98a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +dist/*.js diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a21bee8 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +*.jsx diff --git a/package.json b/package.json index 82c81b1..3697058 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,11 @@ "name": "react-countdown-timer", "version": "1.0.3", "description": "A timer component for React that counts down to zero for a specified number of milliseconds.", - "main": "countdown_timer.jsx", - "scripts": {}, + "main": "dist/countdown_timer.js", + "scripts": { + "build": "jsx countdown_timer.jsx > dist/countdown_timer.js", + "prepublish": "npm run build" + }, "repository": { "type": "git", "url": "https://github.com/uken/react-countdown-timer" @@ -19,5 +22,8 @@ "homepage": "https://github.com/uken/react-countdown-timer", "dependencies": { "react": "^0.13.3" + }, + "devDependencies": { + "react-tools": "^0.13.3" } } From 55459b9ac88dc921983101848b06a557ffccb7a8 Mon Sep 17 00:00:00 2001 From: Mike Klemarewski Date: Wed, 24 Feb 2016 14:17:30 -0800 Subject: [PATCH 2/2] Make sure build can create the dist directory --- .gitignore | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 96b98a0..b947077 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -dist/*.js +dist/ diff --git a/package.json b/package.json index 3697058..16ad3a5 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A timer component for React that counts down to zero for a specified number of milliseconds.", "main": "dist/countdown_timer.js", "scripts": { - "build": "jsx countdown_timer.jsx > dist/countdown_timer.js", + "build": "jsx -x jsx ./ dist", "prepublish": "npm run build" }, "repository": {