Skip to content

Commit

Permalink
Add .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
astralarya committed Aug 5, 2016
1 parent 16b5504 commit a2046d2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
14 changes: 10 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let path = require('path');
let fs = require('fs');
let targz = require('tar.gz');
let archiver = require('archiver');

function WebpackArchivePlugin(options) {
}
Expand All @@ -10,9 +10,15 @@ WebpackArchivePlugin.prototype.apply = function(compiler) {
let output = compiler.options.output.path;

// Create tarfile
let read = targz().createReadStream(output);
let write = fs.createWriteStream(`${output}.tar.gz`);
read.pipe(write);
let tar = archiver('tar');
tar.pipe(fs.createWriteStream(`${output}.tar.gz`));

for(let asset in compiler.assets) {
console.log(asset);
tar.append(fs.createReadStream(file1), {name: 'file1.txt'});
}

tar.finalize();

callback();
});
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "webpack-archive-plugin",
"version": "1.0.0",
"description": "Webpack plugin to create archives of emitted files",
"repository": "git+https://github.com/autochthe/webpack-archive-plugin.git",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "GPL-3.0"
"author": "Mara Kim",
"license": "GPL-3.0",
"dependencies": {
"archiver": "^1.0.1"
}
}

0 comments on commit a2046d2

Please sign in to comment.