-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from HarvestProfit/2-source-maps
Add source maps
- Loading branch information
Showing
7 changed files
with
3,514 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"name": "harvest-profit-units", | ||
"version": "1.0.0-alpha.3", | ||
"name": "@harvest-profit/units", | ||
"version": "1.0.0", | ||
"description": "Units helper for Harvest Profit javascript applications", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/HarvestProfit/harvest-profit-units", | ||
"author": "Jaryd Krishnan <[email protected]>", | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"build": "babel src -d dist", | ||
"build": "rm -rf ./dist && webpack --config webpack.config.js --progress --profile -p", | ||
"clean": "rm -rf ./dist", | ||
"report-coverage": "coveralls < ./coverage/lcov.info", | ||
"test": "jest test/ --coverage" | ||
|
@@ -26,15 +26,30 @@ | |
"^.+\\.jsx?$": "babel-jest" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"lodash": "^4.17.4", | ||
"mathjs": "^3.17.0" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.4", | ||
"mathjs": "^3.17.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.2.2", | ||
"babel-loader": "^7.1.3", | ||
"babel-preset-airbnb": "^2.4.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"coveralls": "^3.0.0", | ||
"jest": "^21.2.1" | ||
"eslint": "^4.18.2", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-plugin-import": "^2.9.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.3", | ||
"eslint-plugin-react": "^7.7.0", | ||
"jest": "^21.2.1", | ||
"uglifyjs-webpack-plugin": "^1.2.2", | ||
"webpack": "^4.1.0", | ||
"webpack-cli": "^2.0.10" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import math from './Math'; | ||
import UnitsHelper from './UnitsHelper'; | ||
|
||
export default UnitsHelper; | ||
export default { math, UnitsHelper }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const path = require('path'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
|
||
/** | ||
* This is our webpack config for the final built product. | ||
* It pumps out a dist/index.js file that is ready for web-based use. | ||
*/ | ||
module.exports = { | ||
entry: './src/index.js', | ||
output: { | ||
filename: 'index.js', | ||
library: 'HarvestProfitUnits', | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true, | ||
path: path.resolve(__dirname, 'dist'), | ||
}, | ||
/* We use uglifyjs to compile/minify our bundle from this project */ | ||
plugins: [ | ||
new UglifyJSPlugin({ | ||
parallel: true, | ||
sourceMap: true, | ||
}), | ||
], | ||
/* We use both math.js and lodash, but have them externally */ | ||
externals: { | ||
lodash: 'lodash', | ||
mathjs: 'mathjs', | ||
}, | ||
devtool: 'source-map', | ||
/* We use babel-loader to replicate the .babelrc file in webpack */ | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /(node_modules|bower_components)/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: [ | ||
'airbnb', | ||
'stage-2', | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.