1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const globby = require("globby");
|
4 | const fs = require("graceful-fs");
|
5 | const path = require("path");
|
6 | exports.default = (archive, packagePath) => {
|
7 | const fullPath = path.resolve(packagePath);
|
8 | return globby([`${fullPath}/*.js`])
|
9 | .then(files => {
|
10 | files.forEach(file => {
|
11 | archive.append(fs.createReadStream(file), {
|
12 | name: file.replace(path.resolve(packagePath), '')
|
13 | });
|
14 | });
|
15 | })
|
16 | .catch(console.error);
|
17 | };
|