UNPKG

558 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const globby = require("globby");
4const fs = require("graceful-fs");
5const path = require("path");
6exports.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};