npm and error messages

This commit is contained in:
2018-10-27 03:51:47 -05:00
parent 692ab70565
commit 025a403027
29601 changed files with 2759363 additions and 14 deletions

View File

@@ -0,0 +1,29 @@
let Task = require('./Task');
let FileCollection = require('../FileCollection');
class ConcatenateFilesTask extends Task {
/**
* Run the task.
*/
run() {
this.files = new FileCollection(this.data.src);
this.merge();
}
/**
* Merge the files into one.
*/
merge() {
this.assets.push(this.files.merge(this.data.output, this.data.babel));
}
/**
* Handle when a relevant source file is changed.
*/
onChange(updatedFile) {
this.merge();
}
}
module.exports = ConcatenateFilesTask;

46
node_modules/laravel-mix/src/tasks/CopyFilesTask.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
let Task = require('./Task');
let FileCollection = require('../FileCollection');
const path = require('path');
class CopyFilesTask extends Task {
/**
* Run the task.
*/
run() {
let copy = this.data;
this.files = new FileCollection(copy.from);
this.files.copyTo(copy.to);
this.assets = this.files.assets;
}
/**
* Handle when a relevant source file is changed.
*
* @param {string} updatedFile
*/
onChange(updatedFile) {
let destination = this.data.to;
// If we're copying a src directory recursively, we have to calculate
// the correct destination path, based on the src directory tree.
if (
!Array.isArray(this.data.from) &&
new File(this.data.from).isDirectory()
) {
destination = destination.append(
path
.normalize(updatedFile)
.replace(path.normalize(this.data.from), '')
);
}
console.log(`Copying ${updatedFile} to ${destination.path()}`);
this.files.copyTo(destination, new File(updatedFile));
}
}
module.exports = CopyFilesTask;

43
node_modules/laravel-mix/src/tasks/Task.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
let chokidar = require('chokidar');
class Task {
/**
* Create a new task instance.
*
* @param {Object} data
*/
constructor(data) {
this.data = data;
this.assets = [];
this.isBeingWatched = false;
}
/**
* Watch all relevant files for changes.
*
* @param {boolean} usePolling
*/
watch(usePolling = false) {
if (this.isBeingWatched) return;
let files = this.files.get();
let watcher = chokidar
.watch(files, { usePolling, persistent: true })
.on('change', this.onChange.bind(this));
// Workaround for issue with atomic writes.
// See https://github.com/paulmillr/chokidar/issues/591
if (!usePolling) {
watcher.on('raw', (event, path, { watchedPath }) => {
if (event === 'rename') {
watcher.unwatch(files);
watcher.add(files);
}
});
}
this.isBeingWatched = true;
}
}
module.exports = Task;

30
node_modules/laravel-mix/src/tasks/VersionFilesTask.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
let Task = require('./Task');
let FileCollection = require('../FileCollection');
class VersionFilesTask extends Task {
/**
* Run the task.
*/
run() {
this.files = new FileCollection(this.data.files);
this.assets = this.data.files.map(file => {
file = new File(file);
Mix.manifest.hash(file.pathFromPublic());
return file;
});
}
/**
* Handle when a relevant source file is changed.
*
* @param {string} updatedFile
*/
onChange(updatedFile) {
Mix.manifest.hash(new File(updatedFile).pathFromPublic()).refresh();
}
}
module.exports = VersionFilesTask;