Skip to content

Commit

Permalink
Add support for crude polyfilling
Browse files Browse the repository at this point in the history
  • Loading branch information
thomrand committed Aug 8, 2016
1 parent ad84bba commit 570eba3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ function getFileNameFromPath(filePath) {
.join('_');
}

function getFileHash(files) {
function getFileHash(files, polyfillPath) {
return files.reduce(function (prev, next) {
prev[getFileNameFromPath(next)] = "./" + next;
var path = "./" + next;
prev[getFileNameFromPath(next)] = polyfillPath ? [ polyfillPath, path ] : path;
return prev;
}, {});
}
Expand Down Expand Up @@ -115,7 +116,7 @@ function run(input, flags, showHelp) {

var webpackConfig = getWebpackConfig(
existingWebpackConfig,
getFileHash(getFiles(testDiscoveryPattern)),
getFileHash(getFiles(testDiscoveryPattern), flags.polyfill),
outDir
);

Expand All @@ -130,4 +131,4 @@ function run(input, flags, showHelp) {
);
}

module.exports = run;
module.exports = run;
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"name": "ava-webpack",
"version": "1.0.6",
"version": "1.0.7",
"description": "",
"main": "index.js",
"scripts": {},
"author": "",
"author": {
"name": "Thomas Andresen",
"email": "[email protected]"
},
"url": "https://github.com/thrandre/ava-webpack/issues",
"license": "ISC",
"bin": "cli.js",
"repository": {
"type": "git",
"url": "https://github.com/thrandre/ava-webpack.git"
},
"dependencies": {
"ava": "^0.15.2",
"bluebird": "^3.4.1",
Expand Down

0 comments on commit 570eba3

Please sign in to comment.