Skip to content

Commit

Permalink
add prepublish and babel build
Browse files Browse the repository at this point in the history
  • Loading branch information
playground committed Apr 1, 2017
1 parent 8ea29b9 commit 583b827
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ build/Release
# Dependency directories
node_modules
jspm_packages
distribution

# Optional npm cache directory
.npm
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"name": "@physicalweb/number-formatter",
"version": "1.0.2",
"description": "",
"main": "index.js",
"main": "./distribution/index.js",
"scripts": {
"build": "babel source --out-dir distribution",
"prepublish": "npm run build",
"test": "nyc babel-tape-runner test/**/*.test.js",
"cover": "nyc --reporter=lcov --reporter=text-lcov babel-tape-runner test/**/*.test.js"
},
Expand All @@ -20,8 +22,7 @@
"dependencies": {
"babel-cli": "^6.24.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-stage-3": "^6.22.0",
"babel-register": "^6.24.0"
"babel-preset-stage-3": "^6.22.0"
},
"devDependencies": {
"babel-tape-runner": "^2.0.1",
Expand Down
4 changes: 1 addition & 3 deletions index.js → source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* @param {string} locale
* @return {string}
*/
const numFormatter = (number, locale) => {
module.exports = (number, locale) => {
return number.toLocaleString(locale);
};

export {numFormatter}
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'tape';
import {numFormatter} from '../index';
import numFormatter from '../source/index';

test('numFormatter', (assert) => {
let result = numFormatter(1);
Expand Down

0 comments on commit 583b827

Please sign in to comment.