Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/webpack-cli/lib/generators/ |
Upload File : |
const path = require("path"); const mkdirp = require("mkdirp"); const Generator = require("yeoman-generator"); const copyUtils = require("../utils/copy-utils"); /** * Creates a Yeoman Generator that generates a project conforming * to webpack-defaults. * * @param {any[]} prompts An array of Yeoman prompt objects * * @param {string} templateDir Absolute path to template directory * * @param {string[]} copyFiles An array of file paths (relative to `./templates`) * of files to be copied to the generated project. File paths should be of the * form `path/to/file.js.tpl`. * * @param {string[]} copyTemplateFiles An array of file paths (relative to * `./templates`) of files to be copied to the generated project. Template * file paths should be of the form `path/to/_file.js.tpl`. * * @param {Function} templateFn A function that is passed a generator instance and * returns an object containing data to be supplied to the template files. * * @returns {Generator} A class extending Generator */ function webpackGenerator( prompts, templateDir, copyFiles, copyTemplateFiles, templateFn ) { //eslint-disable-next-line return class extends Generator { prompting() { return this.prompt(prompts).then(props => { this.props = props; }); } default() { const currentDirName = path.basename(this.destinationPath()); if (currentDirName !== this.props.name) { this.log(` Your project must be inside a folder named ${this.props.name} I will create this folder for you. `); mkdirp(this.props.name); const pathToProjectDir = this.destinationPath(this.props.name); this.destinationRoot(pathToProjectDir); } } writing() { this.copy = copyUtils.generatorCopy(this, templateDir); this.copyTpl = copyUtils.generatorCopyTpl( this, templateDir, templateFn(this) ); copyFiles.forEach(this.copy); copyTemplateFiles.forEach(this.copyTpl); } install() { this.npmInstall(["webpack-defaults", "bluebird"], { "save-dev": true }).then(() => { this.spawnCommand("npm", ["run", "webpack-defaults"]); }); } }; } module.exports = webpackGenerator;