Skip to content

Commit

Permalink
add version and license banner to packaged files
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Nov 30, 2016
1 parent b0ca2e8 commit 6df01d5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test:debug": "DEBUG=genscrape:* npm test",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive",
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"build": "mkdir -p dist && npm run build:full && npm run build:min",
"build:full": "webpack --output-library genscrape src/main.js dist/genscrape.js",
"build:min": "webpack --output-library genscrape --optimize-minimize src/main.js dist/genscrape.min.js",
"build": "mkdir -p dist && npm run build:dev && npm run build:min",
"build:dev": "webpack",
"build:min": "webpack --min",
"prepublish": "npm test && npm run build"
},
"repository": {
Expand All @@ -34,10 +34,12 @@
"gedcomx-js": "2.1.0"
},
"devDependencies": {
"bannerjs": "^1.0.5",
"chai": "3.5.0",
"coveralls": "2.11.9",
"istanbul": "0.4.3",
"jsdom": "9.5.0",
"minimist": "^1.2.0",
"mocha": "3.1.0",
"nock": "8.0.0",
"webpack": "^1.13.1"
Expand Down
22 changes: 22 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var bannerjs = require('bannerjs'),
webpack = require('webpack'),
argv = require('minimist')(process.argv);

module.exports = {
entry: './src/main.js',
output: {
filename: 'genscrape.js',
path: __dirname + '/dist',
library: 'genscrape',
libraryTarget: 'umd'
},
plugins: [
new webpack.BannerPlugin(bannerjs.onebanner(), {raw: true})
]
};

// Add minification, enabled by a cli flag
if(argv.min){
module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin());
module.exports.output.filename = 'genscrape.min.js';
}

0 comments on commit 6df01d5

Please sign in to comment.