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

30
node_modules/laravel-mix/src/components/Autoload.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
class Autoload {
/**
* Register the component.
*
* @param {Object} libs
* @return {void}
*/
register(libs) {
let aliases = {};
Object.keys(libs).forEach(library => {
[].concat(libs[library]).forEach(alias => {
aliases[alias] = library.includes('.') ? library.split('.') : library;
});
});
this.aliases = aliases;
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
let webpack = require('webpack');
return new webpack.ProvidePlugin(this.aliases);
}
}
module.exports = Autoload;

View File

@@ -0,0 +1,10 @@
class AutomaticComponent {
/**
* Create a new component instance.
*/
constructor() {
this.passive = true;
}
}
module.exports = AutomaticComponent;

66
node_modules/laravel-mix/src/components/Browsersync.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
class Browsersync {
/**
* The API name for the component.
*/
name() {
return 'browserSync';
}
/**
* Required dependencies for the component.
*/
dependencies() {
this.requiresReload = true;
return ['browser-sync', 'browser-sync-webpack-plugin@2.0.1'];
}
/**
* Register the component.
*
* @param {Object} userConfig
*/
register(userConfig) {
this.userConfig =
typeof userConfig == 'string' ? { proxy: userConfig } : userConfig;
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
let BrowserSyncPlugin = require('browser-sync-webpack-plugin');
return new BrowserSyncPlugin(this.config(), { reload: false });
}
/**
* Build the BrowserSync configuration.
*/
config() {
return Object.assign(
{
host: 'localhost',
port: 3000,
proxy: 'app.test',
files: [
'app/**/*.php',
'resources/views/**/*.php',
'public/js/**/*.js',
'public/css/**/*.css'
],
snippetOptions: {
rule: {
match: /(<\/body>|<\/pre>)/i,
fn: function(snippet, match) {
return snippet + match;
}
}
}
},
this.userConfig
);
}
}
module.exports = Browsersync;

24
node_modules/laravel-mix/src/components/Coffee.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
let JavaScript = require('./JavaScript');
class Coffee extends JavaScript {
/**
* Required dependencies for the component.
*/
dependencies() {
return ['coffee-loader', 'coffeescript'].concat(super.dependencies());
}
/**
* webpack rules to be appended to the master config.
*/
webpackRules() {
return [
{
test: /\.coffee$/,
use: ['coffee-loader']
}
].concat(super.webpackRules());
}
}
module.exports = Coffee;

54
node_modules/laravel-mix/src/components/Combine.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
let ConcatFilesTask = require('../tasks/ConcatenateFilesTask');
let Assert = require('../Assert');
let _ = require('lodash');
let glob = require('glob');
class Combine {
/**
* The API name for the component.
*/
name() {
return ['combine', 'scripts', 'babel', 'styles', 'minify'];
}
/**
*
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Boolean} babel
*/
register(src, output = '', babel = false) {
if (this.caller === 'babel') {
babel = true;
}
if (this.caller === 'minify') {
if (Array.isArray(src)) {
src.forEach(file => this.register(file));
return this;
}
output = src.replace(/\.([a-z]{2,})$/i, '.min.$1');
}
output = new File(output);
Assert.combine(src, output);
if (typeof src === 'string' && File.find(src).isDirectory()) {
src = _.pull(
glob.sync(path.join(src, '**/*'), { nodir: true }),
output.relativePath()
);
}
let task = new ConcatFilesTask({ src, output, babel });
Mix.addTask(task);
}
}
module.exports = Combine;

View File

@@ -0,0 +1,173 @@
let mix = require('../index');
let Assert = require('../Assert');
let webpackMerge = require('webpack-merge');
let components = [
'JavaScript',
'Preact',
'React',
'Coffee',
'TypeScript',
'FastSass',
'Less',
'Sass',
'Stylus',
'PostCss',
'Css',
'Browsersync',
'Combine',
'Copy',
'Autoload',
'Version',
'Extend',
'Extract',
'Notifications',
'DisableNotifications',
'PurifyCss'
];
class ComponentFactory {
/**
* Install all default components.
*/
installAll() {
components
.map(name => require(`./${name}`))
.forEach(this.install.bind(this));
}
/**
* Install a component.
*
* @param {Component} Component
*/
install(Component) {
let component =
typeof Component === 'function' ? new Component() : Component;
this.registerComponent(component);
Mix.listen('init', () => {
if (!component.activated && !component.passive) {
return;
}
component.dependencies && this.installDependencies(component);
component.boot && component.boot();
component.babelConfig && this.applyBabelConfig(component);
Mix.listen('loading-entry', entry => {
if (component.webpackEntry) {
component.webpackEntry(entry);
}
});
Mix.listen('loading-rules', rules => {
component.webpackRules && this.applyRules(rules, component);
});
Mix.listen('loading-plugins', plugins => {
component.webpackPlugins &&
this.applyPlugins(plugins, component);
});
Mix.listen('configReady', config => {
component.webpackConfig && component.webpackConfig(config);
});
});
}
/**
* Register the component.
*
* @param {Object} component
*/
registerComponent(component) {
[]
.concat(
typeof component.name === 'function'
? component.name()
: component.constructor.name.toLowerCase()
)
.forEach(name => {
mix[name] = (...args) => {
Mix.components.record(name, component);
component.caller = name;
component.register && component.register(...args);
component.activated = true;
return mix;
};
// If we're dealing with a passive component that doesn't
// need to be explicitly triggered by the user, we'll
// call it now.
if (component.passive) {
mix[name]();
}
// Components can optionally write to the Mix API directly.
if (component.mix) {
Object.keys(component.mix()).forEach(name => {
mix[name] = component.mix()[name];
});
}
});
}
/**
* Install the component's dependencies.
*
* @param {Object} component
*/
installDependencies(component) {
[]
.concat(component.dependencies())
.filter(dependency => dependency)
.tap(dependencies => {
Assert.dependencies(dependencies, component.requiresReload);
});
}
/**
*
* Apply the Babel configuration for the component.
*
* @param {Object} component
*/
applyBabelConfig(component) {
Config.babelConfig = webpackMerge.smart(
Config.babelConfig,
component.babelConfig()
);
}
/**
*
* Apply the webpack rules for the component.
*
* @param {Object} component
*/
applyRules(rules, component) {
tap(component.webpackRules(), newRules => {
newRules && rules.push(...[].concat(newRules));
});
}
/**
*
* Apply the webpack plugins for the component.
*
* @param {Object} component
*/
applyPlugins(plugins, component) {
tap(component.webpackPlugins(), newPlugins => {
newPlugins && plugins.push(...[].concat(newPlugins));
});
}
}
module.exports = ComponentFactory;

43
node_modules/laravel-mix/src/components/Components.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
class Components {
/**
* Create a new Components instance.
*/
constructor() {
this.components = [];
}
/**
* Record a newly registered component.
*
* @param {string} name
* @param {Component} component
*/
record(name, component) {
this.components[name] = component;
}
/**
* Retrieve a recorded component.
*
* @param {string} name
*/
get(name) {
return this.components[name];
}
/**
* Determine if the given component name has been registered.
*/
has(name) {
return this.components.hasOwnProperty(name);
}
/**
* Retrieve all components.
*/
all() {
return this.components;
}
}
module.exports = Components;

22
node_modules/laravel-mix/src/components/Copy.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
let CopyFilesTask = require('../tasks/CopyFilesTask');
class Copy {
/**
* The API name for the component.
*/
name() {
return ['copy', 'copyDirectory'];
}
/**
* Register the component.
*
* @param {*} from
* @param {string} to
*/
register(from, to) {
Mix.addTask(new CopyFilesTask({ from, to: new File(to) }));
}
}
module.exports = Copy;

42
node_modules/laravel-mix/src/components/Css.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
let AutomaticComponent = require('./AutomaticComponent');
class Css extends AutomaticComponent {
/**
* webpack rules to be appended to the master config.
*/
webpackRules() {
return [
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /\.s[ac]ss$/,
exclude: this.excludePathsFor('sass'),
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.less$/,
exclude: this.excludePathsFor('less'),
loaders: ['style-loader', 'css-loader', 'less-loader']
}
];
}
/**
* Paths to be excluded from the loader.
*
* @param {string} preprocessor
*/
excludePathsFor(preprocessor) {
let exclusions = Mix.components.get(preprocessor);
return exclusions
? exclusions.details.map(preprocessor => preprocessor.src.path())
: [];
}
}
module.exports = Css;

View File

@@ -0,0 +1,24 @@
class DisableNotifications {
/**
* The API name for the component.
*/
name() {
return ['disableNotifications', 'disableSuccessNotifications'];
}
/**
* Register the component.
*/
register() {
if (this.caller === 'disableSuccessNotifications') {
Config.notifications = {
onSuccess: false,
onFailure: true
};
} else {
Config.notifications = false;
}
}
}
module.exports = DisableNotifications;

122
node_modules/laravel-mix/src/components/Example.js generated vendored Normal file
View File

@@ -0,0 +1,122 @@
/**
* This file represents an example component interface
* for Mix. All new components can be "inserted" into
* Mix, like so:
*
* // webpack.mix.js
*
* mix.extend('foo', new Example());
*
* mix.foo();
*/
class Example {
/**
* The optional name to be used when called by Mix.
* Defaults to the class name, lowercased.
*
* Ex: mix.example();
*
* @return {String|Array}
*/
name() {
// Example:
// return 'example';
// return ['example', 'alias'];
}
/**
* All dependencies that should be installed by Mix.
*
* @return {Array}
*/
dependencies() {
// Example:
// return ['typeScript', 'ts'];
}
/**
* Register the component.
*
* When your component is called, all user parameters
* will be passed to this method.
*
* Ex: register(src, output) {}
* Ex: mix.yourPlugin('src/path', 'output/path');
*
* @param {*} ...params
* @return {void}
*
*/
register() {
// Example:
// this.config = { proxy: arg };
}
/**
* Boot the component. This method is triggered after the
* user's webpack.mix.js file has executed.
*/
boot() {
// Example:
// if (Config.options.foo) {}
}
/**
* Append to the master Mix webpack entry object.
*
* @param {Entry} entry
* @return {void}
*/
webpackEntry(entry) {
// Example:
// entry.add('foo', 'bar');
}
/**
* Rules to be merged with the master webpack loaders.
*
* @return {Array|Object}
*/
webpackRules() {
// Example:
// return {
// test: /\.less$/,
// loaders: ['...']
// });
}
/*
* Plugins to be merged with the master webpack config.
*
* @return {Array|Object}
*/
webpackPlugins() {
// Example:
// return new webpack.ProvidePlugin(this.aliases);
}
/**
* Override the generated webpack configuration.
*
* @param {Object} webpackConfig
* @return {void}
*/
webpackConfig(webpackConfig) {
// Example:
// webpackConfig.resolve.extensions.push('.ts', '.tsx');
}
/**
* Babel config to be merged with Mix's defaults.
*
* @return {Object}
*/
babelConfig() {
// Example:
// return { presets: ['react'] };
}
}
// Usage:
// mix.extend('example', new Example());

31
node_modules/laravel-mix/src/components/Extend.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
let ComponentFactory = require('./ComponentFactory');
class Extend {
/**
* Register the component.
*
* @param {string} name
* @param {Component} component
*/
register(name, component) {
if (typeof component !== 'function') {
component.name = () => name;
return new ComponentFactory().install(component);
}
new ComponentFactory().install({
name: () => name,
register(...args) {
this.args = args;
},
webpackConfig(config) {
component.call(this, config, ...this.args);
}
});
}
}
module.exports = Extend;

56
node_modules/laravel-mix/src/components/Extract.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
let webpack = require('webpack');
class Extract {
/**
* Create a new component instance.
*/
constructor() {
this.extractions = [];
}
/**
* Register the component.
*
* @param {*} libs
* @param {string} output
*/
register(libs, output) {
this.extractions.push({ libs, output });
}
/**
* Assets to append to the webpack entry.
*
* @param {Entry} entry
*/
webpackEntry(entry) {
this.extractions = this.extractions.map(
entry.addExtraction.bind(entry)
);
// If we are extracting vendor libraries, then we also need
// to extract Webpack's manifest file to assist with caching.
if (this.extractions.length) {
this.extractions.push(
path.join(entry.base, 'manifest').replace(/\\/g, '/')
);
}
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
// If we're extracting any vendor libraries, then we
// need to add the CommonChunksPlugin to strip out
// all relevant code into its own file.
if (this.extractions.length) {
return new webpack.optimize.CommonsChunkPlugin({
names: this.extractions,
minChunks: Infinity
});
}
}
}
module.exports = Extract;

37
node_modules/laravel-mix/src/components/FastSass.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
let Preprocessor = require('./Preprocessor');
let Assert = require('../Assert');
class FastSass extends Preprocessor {
/**
* The API name for the component.
*/
name() {
return ['fastSass', 'standaloneSass'];
}
/**
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Object} pluginOptions
*/
register(src, output, pluginOptions = {}) {
Assert.exists(src);
return this.preprocess('fastSass', src, output, pluginOptions);
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
let FastSassPlugin = require('../webpackPlugins/FastSassPlugin');
return (super.webpackPlugins() || []).concat(
new FastSassPlugin(this.details)
);
}
}
module.exports = FastSass;

92
node_modules/laravel-mix/src/components/JavaScript.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
let glob = require('glob');
let Assert = require('../Assert');
let MockEntryPlugin = require('../webpackPlugins/MockEntryPlugin');
let Vue = require('./Vue');
class JavaScript {
constructor() {
this.vue = new Vue();
this.toCompile = [];
}
/**
* The API name for the component.
*/
name() {
let name = this.constructor.name.toLowerCase();
return name === 'javascript' ? ['js', 'vue'] : name;
}
/**
* Required dependencies for the component.
*/
dependencies() {
return this.vue.dependencies();
}
/**
* Register the component.
*
* @param {*} entry
* @param {string} output
*/
register(entry, output) {
if (typeof entry === 'string' && entry.includes('*')) {
entry = glob.sync(entry);
}
Assert.js(entry, output);
entry = [].concat(entry).map(file => new File(file));
output = new File(output);
this.toCompile.push({ entry, output });
Mix.bundlingJavaScript = true;
}
/**
* Assets to append to the webpack entry.
*
* @param {Entry} entry
*/
webpackEntry(entry) {
this.toCompile.forEach(js => {
entry.addFromOutput(
js.entry.map(file => file.path()),
js.output,
js.entry[0]
);
});
}
/**
* webpack rules to be appended to the master config.
*/
webpackRules() {
return [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: [
{
loader: 'babel-loader',
options: Config.babel()
}
]
}
];
}
/**
* Override the generated webpack configuration.
*
* @param {Object} webpackConfig
*/
webpackConfig(webpackConfig) {
this.vue.webpackConfig(webpackConfig);
}
}
module.exports = JavaScript;

23
node_modules/laravel-mix/src/components/Less.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
let Preprocessor = require('./Preprocessor');
class Less extends Preprocessor {
/**
* Required dependencies for the component.
*/
dependencies() {
return ['less-loader', 'less'];
}
/**
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Object} pluginOptions
*/
register(src, output, pluginOptions = {}) {
this.preprocess('less', src, output, pluginOptions);
}
}
module.exports = Less;

View File

@@ -0,0 +1,23 @@
let AutomaticComponent = require('./AutomaticComponent');
class Notifications extends AutomaticComponent {
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
if (Mix.isUsing('notifications')) {
let WebpackNotifierPlugin = require('webpack-notifier');
return new WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: Config.notifications.onSuccess,
hint: process.platform === 'linux' ? 'int:transient:1' : undefined,
contentImage: Mix.paths.root(
'node_modules/laravel-mix/icons/laravel.png'
)
});
}
}
}
module.exports = Notifications;

49
node_modules/laravel-mix/src/components/PostCss.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
let Assert = require('../Assert');
let Preprocessor = require('./Preprocessor');
class PostCss extends Preprocessor {
/**
* The API name for the component.
*/
name() {
return 'postCss';
}
/**
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Array} postCssPlugins
*/
register(src, output, postCssPlugins = []) {
Assert.preprocessor('postCss', src, output);
src = new File(src);
output = this.normalizeOutput(
new File(output),
src.nameWithoutExtension() + '.css'
);
this.details = (this.details || []).concat({
type: 'postCss',
src,
output,
postCssPlugins: [].concat(postCssPlugins)
});
}
/**
* Override the generated webpack configuration.
*
* @param {Object} config
*/
webpackConfig(config) {
config.module.rules.find(
rule => rule.test.toString() === '/\\.css$/'
).exclude = this.details.map(postCss => postCss.src.path());
}
}
module.exports = PostCss;

21
node_modules/laravel-mix/src/components/Preact.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
let JavaScript = require('./JavaScript');
class Preact extends JavaScript {
/**
* Required dependencies for the component.
*/
dependencies() {
return ['babel-preset-preact'].concat(super.dependencies());
}
/**
* Babel config to be merged with Mix's defaults.
*/
babelConfig() {
return {
presets: ['preact']
};
}
}
module.exports = Preact;

173
node_modules/laravel-mix/src/components/Preprocessor.js generated vendored Normal file
View File

@@ -0,0 +1,173 @@
let Assert = require('../Assert');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
class Preprocessor {
/**
* Assets to append to the webpack entry.
*
* @param {Entry} entry
*/
webpackEntry(entry) {
this.details.forEach(detail => {
if (detail.type === 'fastsass') return;
entry.add(entry.keys()[0], detail.src.path());
});
}
/**
* webpack rules to be appended to the master config.
*/
webpackRules() {
let rules = [];
this.details.forEach(preprocessor => {
if (preprocessor.type === 'fastsass') return;
let outputPath = preprocessor.output.filePath
.replace(Config.publicPath + path.sep, path.sep)
.replace(/\\/g, '/');
tap(new ExtractTextPlugin(outputPath), extractPlugin => {
let loaders = [
{
loader: 'css-loader',
options: {
url: Config.processCssUrls,
sourceMap: Mix.isUsing('sourcemaps'),
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
sourceMap:
preprocessor.type === 'sass' &&
Config.processCssUrls
? true
: Mix.isUsing('sourcemaps'),
ident: 'postcss',
plugins: (function() {
let plugins = Config.postCss;
if (
preprocessor.postCssPlugins &&
preprocessor.postCssPlugins.length
) {
plugins = preprocessor.postCssPlugins;
}
if (
Config.autoprefixer &&
Config.autoprefixer.enabled
) {
plugins.push(
require('autoprefixer')(
Config.autoprefixer.options
)
);
}
return plugins;
})()
}
}
];
if (preprocessor.type === 'sass' && Config.processCssUrls) {
loaders.push({
loader: 'resolve-url-loader',
options: {
sourceMap: true,
root: Mix.paths.root('node_modules')
}
});
}
if (preprocessor.type !== 'postCss') {
loaders.push({
loader: `${preprocessor.type}-loader`,
options: Object.assign(preprocessor.pluginOptions, {
sourceMap:
preprocessor.type === 'sass' &&
Config.processCssUrls
? true
: Mix.isUsing('sourcemaps')
})
});
}
rules.push({
test: preprocessor.src.path(),
use: extractPlugin.extract({
fallback: 'style-loader',
use: loaders
})
});
this.extractPlugins = (this.extractPlugins || []).concat(
extractPlugin
);
});
});
return rules;
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
return this.extractPlugins;
}
/**
* Register a generic CSS preprocessor.
*
* @param {string} type
* @param {string} src
* @param {string} output
* @param {object} pluginOptions
*/
preprocess(type, src, output, pluginOptions = {}) {
Assert.preprocessor(type, src, output);
src = new File(src);
output = this.normalizeOutput(
new File(output),
src.nameWithoutExtension() + '.css'
);
this.details = (this.details || []).concat({
type: this.constructor.name.toLowerCase(),
src,
output,
pluginOptions
});
if (type === 'fastSass') {
Mix.addAsset(output);
}
return this;
}
/**
* Generate a full output path, using a fallback
* file name, if a directory is provided.
*
* @param {Object} output
* @param {Object} fallbackName
*/
normalizeOutput(output, fallbackName) {
if (output.isDirectory()) {
output = new File(path.join(output.filePath, fallbackName));
}
return output;
}
}
module.exports = Preprocessor;

53
node_modules/laravel-mix/src/components/PurifyCss.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
let AutomaticComponent = require('./AutomaticComponent');
let glob = require('glob');
class PurifyCss extends AutomaticComponent {
/**
* Required dependencies for the component.
*/
dependencies() {
if (Config.purifyCss) {
this.requiresReload = true;
return ['purifycss-webpack', 'purify-css'];
}
}
/**
* Override the generated webpack configuration.
*
* @param {Object} config
*/
webpackConfig(config) {
if (Config.purifyCss) {
Config.purifyCss = this.build(Config.purifyCss);
let CssPurifierPlugin = require('../webpackPlugins/CssPurifierPlugin');
config.plugins.push(CssPurifierPlugin.build());
}
}
/**
* Build the CSSPurifier plugin options.
*
* @param {Object} options
*/
build(options) {
if (typeof options === 'object' && options.paths) {
let paths = options.paths;
paths.forEach(path => {
if (!path.includes('*')) return;
options.paths.splice(paths.indexOf(path), 1);
options.paths = paths.concat(glob.sync(path));
});
}
return options;
}
}
module.exports = PurifyCss;

21
node_modules/laravel-mix/src/components/React.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
let JavaScript = require('./JavaScript');
class React extends JavaScript {
/**
* Required dependencies for the component.
*/
dependencies() {
return ['babel-preset-react'].concat(super.dependencies());
}
/**
* Babel config to be merged with Mix's defaults.
*/
babelConfig() {
return {
presets: ['react']
};
}
}
module.exports = React;

38
node_modules/laravel-mix/src/components/Sass.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
let Preprocessor = require('./Preprocessor');
class Sass extends Preprocessor {
/**
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Object} pluginOptions
*/
register(src, output, pluginOptions = {}) {
return this.preprocess(
'sass',
src,
output,
this.pluginOptions(pluginOptions)
);
}
/**
* Build the plugin options for sass-loader.
*
* @param {Object} pluginOptions
* @returns {Object}
*/
pluginOptions(pluginOptions) {
return Object.assign(
{
precision: 8,
outputStyle: 'expanded'
},
pluginOptions,
{ sourceMap: true }
);
}
}
module.exports = Sass;

30
node_modules/laravel-mix/src/components/Stylus.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
let Preprocessor = require('./Preprocessor');
class Stylus extends Preprocessor {
/**
* Required dependencies for the component.
*/
dependencies() {
return ['stylus', 'stylus-loader'];
}
/**
* Register the component.
*
* @param {*} src
* @param {string} output
* @param {Object} pluginOptions
*/
register(src, output, pluginOptions = {}) {
pluginOptions = Object.assign(
{
preferPathResolver: 'webpack'
},
pluginOptions
);
return this.preprocess('stylus', src, output, pluginOptions);
}
}
module.exports = Stylus;

45
node_modules/laravel-mix/src/components/TypeScript.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
let JavaScript = require('./JavaScript');
class TypeScript extends JavaScript {
/**
* The API name for the component.
*/
name() {
return ['typeScript', 'ts'];
}
/**
* Required dependencies for the component.
*/
dependencies() {
return ['ts-loader', 'typescript'].concat(super.dependencies());
}
/**
* webpack rules to be appended to the master config.
*/
webpackRules() {
return [].concat(super.webpackRules(), {
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/]
}
});
}
/**
* Override the generated webpack configuration.
*
* @param {Object} config
*/
webpackConfig(config) {
super.webpackConfig(config)
config.resolve.extensions.push('.ts', '.tsx');
config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js';
}
}
module.exports = TypeScript;

48
node_modules/laravel-mix/src/components/Version.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
let glob = require('glob');
let path = require('path');
let webpack = require('webpack');
let VersionFilesTask = require('../tasks/VersionFilesTask');
class Version {
/**
* Register the component.
*
* @param {Array} files
*/
register(files = []) {
files = flatten(
[].concat(files).map(filePath => {
if (File.find(filePath).isDirectory()) {
filePath += path.sep + '**/*';
}
if (!filePath.includes('*')) return filePath;
return glob.sync(
new File(filePath).forceFromPublic().relativePath(),
{ nodir: true }
);
})
);
Mix.addTask(new VersionFilesTask({ files }));
}
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
let WebpackChunkHashPlugin = require('webpack-chunk-hash');
return [
new webpack[
Mix.inProduction()
? 'HashedModuleIdsPlugin'
: 'NamedModulesPlugin'
](),
new WebpackChunkHashPlugin()
];
}
}
module.exports = Version;

151
node_modules/laravel-mix/src/components/Vue.js generated vendored Normal file
View File

@@ -0,0 +1,151 @@
let ExtractTextPlugin = require('extract-text-webpack-plugin');
class Vue {
/**
* Create a new Vue instance.
*/
constructor() {
this.requiresNewCssExtract = false;
}
/**
* Required dependencies for the component.
*/
dependencies() {
if (Config.extractVueStyles && Config.globalVueStyles) {
return ['sass-resources-loader']; // Required for importing global styles into every component.
}
}
/**
* Override the generated webpack configuration.
*
* @param {Object} webpackConfig
*/
webpackConfig(config) {
let { vueLoaderOptions, extractPlugin } = this.vueLoaderOptions();
config.module.rules.push({
test: /\.vue$/,
loader: 'vue-loader',
exclude: /bower_components/,
options: vueLoaderOptions
});
if (this.requiresNewCssExtract) {
config.plugins.push(extractPlugin);
}
}
/**
* vue-loader-specific options.
*/
vueLoaderOptions() {
let extractPlugin = this.extractPlugin();
if (Config.extractVueStyles) {
var sassLoader = extractPlugin.extract({
use: 'css-loader!sass-loader?indentedSyntax',
fallback: 'vue-style-loader'
});
var scssLoader = extractPlugin.extract({
use: 'css-loader!sass-loader',
fallback: 'vue-style-loader'
});
if (Config.globalVueStyles) {
scssLoader.push({
loader: 'sass-resources-loader',
options: {
resources: Mix.paths.root(Config.globalVueStyles)
}
});
sassLoader.push({
loader: 'sass-resources-loader',
options: {
resources: Mix.paths.root(Config.globalVueStyles)
}
});
}
}
let vueLoaderOptions = Object.assign(
{
loaders: Config.extractVueStyles
? {
js: {
loader: 'babel-loader',
options: Config.babel()
},
scss: scssLoader,
sass: sassLoader,
css: extractPlugin.extract({
use: 'css-loader',
fallback: 'vue-style-loader'
}),
stylus: extractPlugin.extract({
use:
'css-loader!stylus-loader?paths[]=node_modules',
fallback: 'vue-style-loader'
}),
less: extractPlugin.extract({
use: 'css-loader!less-loader',
fallback: 'vue-style-loader'
})
}
: {
js: {
loader: 'babel-loader',
options: Config.babel()
}
},
postcss: Config.postCss
},
Config.vue
);
return { vueLoaderOptions, extractPlugin };
}
extractPlugin() {
if (typeof Config.extractVueStyles === 'string') {
this.requiresNewCssExtract = true;
return new ExtractTextPlugin(this.extractFilePath());
}
let preprocessorName = Object.keys(Mix.components.all())
.reverse()
.find(componentName => {
return ['sass', 'less', 'stylus', 'postCss'].includes(
componentName
);
});
if (!preprocessorName) {
this.requiresNewCssExtract = true;
return new ExtractTextPlugin(this.extractFilePath());
}
return Mix.components.get(preprocessorName).extractPlugins.slice(-1)[0];
}
extractFilePath() {
let fileName =
typeof Config.extractVueStyles === 'string'
? Config.extractVueStyles
: 'vue-styles.css';
return fileName.replace(Config.publicPath, '').replace(/^\//, '');
}
}
module.exports = Vue;