From a9950fbe3b36c2c027aba6b61410390ba89c4806 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Sun, 8 Aug 2021 17:21:54 +0800 Subject: [PATCH] feat: add watcher --- packages/uni-app-vite/dist/index.js | 4 +- packages/uni-app-vite/dist/plugin/uni.js | 15 +- packages/uni-app-vite/dist/plugins/copy.js | 47 ----- .../uni-app-vite/dist/plugins/template.js | 41 +++++ packages/uni-app-vite/package.json | 1 + packages/uni-app-vite/src/index.ts | 4 +- packages/uni-app-vite/src/plugin/uni.ts | 15 +- packages/uni-app-vite/src/plugins/copy.ts | 56 ------ packages/uni-app-vite/src/plugins/template.ts | 56 ++++++ packages/uni-cli-shared/package.json | 2 + packages/uni-cli-shared/src/constants.ts | 4 + packages/uni-cli-shared/src/vite/index.ts | 4 +- .../uni-cli-shared/src/vite/plugins/copy.ts | 63 ++++++- packages/uni-cli-shared/src/watcher.ts | 89 +++++++++ packages/vite-plugin-uni/src/cli/action.ts | 8 +- .../src/configResolved/plugins/copy.ts | 52 ------ .../src/configResolved/plugins/index.ts | 6 - .../src/configureServer/easycom.ts | 2 +- packages/vite-plugin-uni/src/index.ts | 8 + packages/vite-plugin-uni/src/plugins/copy.ts | 29 +++ packages/vite-plugin-uni/src/utils/plugin.ts | 9 +- scripts/utils.js | 1 + yarn.lock | 173 ++++++++++++------ 23 files changed, 434 insertions(+), 255 deletions(-) delete mode 100644 packages/uni-app-vite/dist/plugins/copy.js create mode 100644 packages/uni-app-vite/dist/plugins/template.js delete mode 100644 packages/uni-app-vite/src/plugins/copy.ts create mode 100644 packages/uni-app-vite/src/plugins/template.ts create mode 100644 packages/uni-cli-shared/src/watcher.ts delete mode 100644 packages/vite-plugin-uni/src/configResolved/plugins/copy.ts create mode 100644 packages/vite-plugin-uni/src/plugins/copy.ts diff --git a/packages/uni-app-vite/dist/index.js b/packages/uni-app-vite/dist/index.js index d0289380fc..3931f2a5ab 100644 --- a/packages/uni-app-vite/dist/index.js +++ b/packages/uni-app-vite/dist/index.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); const plugin_1 = require("./plugin"); -const copy_1 = require("./plugins/copy"); +const template_1 = require("./plugins/template"); const mainJs_1 = require("./plugins/mainJs"); const manifestJson_1 = require("./plugins/manifestJson"); const pagesJson_1 = require("./plugins/pagesJson"); @@ -21,7 +21,7 @@ function initUniCssScopedPluginOptions() { } const plugins = [ resolveId_1.uniResolveIdPlugin(), - copy_1.uniCopyPlugin(), + template_1.uniTemplatePlugin(), mainJs_1.uniMainJsPlugin(), manifestJson_1.uniManifestJsonPlugin(), pagesJson_1.uniPagesJsonPlugin(), diff --git a/packages/uni-app-vite/dist/plugin/uni.js b/packages/uni-app-vite/dist/plugin/uni.js index 8d59b929e5..9d0b52bd83 100644 --- a/packages/uni-app-vite/dist/plugin/uni.js +++ b/packages/uni-app-vite/dist/plugin/uni.js @@ -1,22 +1,15 @@ "use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.uniOptions = void 0; -const path_1 = __importDefault(require("path")); const uni_shared_1 = require("@dcloudio/uni-shared"); -const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); function uniOptions() { return { copyOptions() { return { - assets: ['hybrid/html'], - targets: [ - { - src: uni_cli_shared_1.normalizePath(path_1.default.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')), - dest: process.env.UNI_OUTPUT_DIR, - }, + assets: [ + 'androidPrivacy.json', + 'hybrid/html/**/*', + 'uni_modules/*/hybrid/html/**/*', ], }; }, diff --git a/packages/uni-app-vite/dist/plugins/copy.js b/packages/uni-app-vite/dist/plugins/copy.js deleted file mode 100644 index 5fafba237c..0000000000 --- a/packages/uni-app-vite/dist/plugins/copy.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.uniCopyPlugin = void 0; -const path_1 = __importDefault(require("path")); -const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); -function uniCopyPlugin() { - return uni_cli_shared_1.uniViteCopyPlugin({ - copyOnce: true, - targets: [ - { - src: uni_cli_shared_1.normalizePath(path_1.default.resolve(__dirname, '../../lib/template/*.js')), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: uni_cli_shared_1.normalizePath(path_1.default.resolve(__dirname, '../../lib/template/*.png')), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: uni_cli_shared_1.normalizePath(require.resolve('@dcloudio/uni-app-plus/dist/uni-app-view.umd.js')), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: uni_cli_shared_1.normalizePath(path_1.default.resolve(__dirname, '../../lib/template/__uniappview.html')), - dest: process.env.UNI_OUTPUT_DIR, - transform(content) { - const { globalStyle } = uni_cli_shared_1.parsePagesJsonOnce(process.env.UNI_INPUT_DIR, process.env.UNI_PLATFORM); - const __uniConfig = { - globalStyle: { - rpxCalcMaxDeviceWidth: globalStyle.rpxCalcMaxDeviceWidth, - rpxCalcBaseDeviceWidth: globalStyle - .rpxCalcBaseDeviceWidth, - }, - }; - return content - .toString() - .replace('/*__uniConfig*/', `var __uniConfig = ${JSON.stringify(__uniConfig)}`); - }, - }, - ], - hook: 'writeBundle', - verbose: process.env.DEBUG ? true : false, - }); -} -exports.uniCopyPlugin = uniCopyPlugin; diff --git a/packages/uni-app-vite/dist/plugins/template.js b/packages/uni-app-vite/dist/plugins/template.js new file mode 100644 index 0000000000..d374336b0d --- /dev/null +++ b/packages/uni-app-vite/dist/plugins/template.js @@ -0,0 +1,41 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uniTemplatePlugin = void 0; +const path_1 = __importDefault(require("path")); +const fs_extra_1 = __importDefault(require("fs-extra")); +const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); +function genViewHtml() { + const viewHtmlStr = fs_extra_1.default.readFileSync(path_1.default.resolve(__dirname, '../../lib/template/__uniappview.html'), 'utf8'); + const { globalStyle } = uni_cli_shared_1.parsePagesJsonOnce(process.env.UNI_INPUT_DIR, process.env.UNI_PLATFORM); + const __uniConfig = { + globalStyle: { + rpxCalcMaxDeviceWidth: globalStyle.rpxCalcMaxDeviceWidth, + rpxCalcBaseDeviceWidth: globalStyle.rpxCalcBaseDeviceWidth, + }, + }; + return viewHtmlStr + .toString() + .replace('/*__uniConfig*/', `var __uniConfig = ${JSON.stringify(__uniConfig)}`); +} +function uniTemplatePlugin() { + return { + name: 'vite:uni-app-template', + configResolved() { + const outputDir = process.env.UNI_OUTPUT_DIR; + return Promise.all([ + fs_extra_1.default.copy(require.resolve('@dcloudio/uni-app-plus/dist/uni-app-view.umd.js'), path_1.default.resolve(outputDir, 'uni-app-view.umd.js'), { + overwrite: true, + }), + fs_extra_1.default + .copy(path_1.default.resolve(__dirname, '../../lib/template/'), outputDir, { + overwrite: true, + }) + .then(() => fs_extra_1.default.writeFile(path_1.default.resolve(outputDir, '__uniappview.html'), genViewHtml())), + ]).then(() => { }); + }, + }; +} +exports.uniTemplatePlugin = uniTemplatePlugin; diff --git a/packages/uni-app-vite/package.json b/packages/uni-app-vite/package.json index aca248ecf8..637ecdd3b4 100644 --- a/packages/uni-app-vite/package.json +++ b/packages/uni-app-vite/package.json @@ -26,6 +26,7 @@ "gitHead": "4dd0e035b52584ff028ee3028c46adc555be0529", "dependencies": { "clean-css": "^5.1.3", + "fs-extra": "^10.0.0", "postcss-import": "^14.0.2", "postcss-load-config": "^3.1.0", "postcss-modules": "^4.1.3" diff --git a/packages/uni-app-vite/src/index.ts b/packages/uni-app-vite/src/index.ts index 5dd89326ba..f118e5e8bd 100644 --- a/packages/uni-app-vite/src/index.ts +++ b/packages/uni-app-vite/src/index.ts @@ -6,7 +6,7 @@ import { parseManifestJsonOnce, } from '@dcloudio/uni-cli-shared' import { UniAppPlugin } from './plugin' -import { uniCopyPlugin } from './plugins/copy' +import { uniTemplatePlugin } from './plugins/template' import { uniMainJsPlugin } from './plugins/mainJs' import { uniManifestJsonPlugin } from './plugins/manifestJson' import { uniPagesJsonPlugin } from './plugins/pagesJson' @@ -29,7 +29,7 @@ function initUniCssScopedPluginOptions() { const plugins = [ uniResolveIdPlugin(), - uniCopyPlugin(), + uniTemplatePlugin(), uniMainJsPlugin(), uniManifestJsonPlugin(), uniPagesJsonPlugin(), diff --git a/packages/uni-app-vite/src/plugin/uni.ts b/packages/uni-app-vite/src/plugin/uni.ts index 959219a83e..1c0de96542 100644 --- a/packages/uni-app-vite/src/plugin/uni.ts +++ b/packages/uni-app-vite/src/plugin/uni.ts @@ -1,22 +1,17 @@ -import path from 'path' import { isServiceNativeTag, isServiceCustomElement, } from '@dcloudio/uni-shared' -import { normalizePath, UniVitePlugin } from '@dcloudio/uni-cli-shared' +import { UniVitePlugin } from '@dcloudio/uni-cli-shared' export function uniOptions(): UniVitePlugin['uni'] { return { copyOptions() { return { - assets: ['hybrid/html'], - targets: [ - { - src: normalizePath( - path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json') - ), - dest: process.env.UNI_OUTPUT_DIR, - }, + assets: [ + 'androidPrivacy.json', + 'hybrid/html/**/*', + 'uni_modules/*/hybrid/html/**/*', ], } }, diff --git a/packages/uni-app-vite/src/plugins/copy.ts b/packages/uni-app-vite/src/plugins/copy.ts deleted file mode 100644 index 8e1cf78983..0000000000 --- a/packages/uni-app-vite/src/plugins/copy.ts +++ /dev/null @@ -1,56 +0,0 @@ -import path from 'path' - -import { - normalizePath, - parsePagesJsonOnce, - uniViteCopyPlugin, -} from '@dcloudio/uni-cli-shared' - -export function uniCopyPlugin() { - return uniViteCopyPlugin({ - copyOnce: true, // 仅copy一次,不支持动态更新 rpxCalcMaxDeviceWidth,rpxCalcBaseDeviceWidth - targets: [ - { - src: normalizePath(path.resolve(__dirname, '../../lib/template/*.js')), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: normalizePath(path.resolve(__dirname, '../../lib/template/*.png')), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: normalizePath( - require.resolve('@dcloudio/uni-app-plus/dist/uni-app-view.umd.js') - ), - dest: process.env.UNI_OUTPUT_DIR, - }, - { - src: normalizePath( - path.resolve(__dirname, '../../lib/template/__uniappview.html') - ), - dest: process.env.UNI_OUTPUT_DIR, - transform(content) { - const { globalStyle } = parsePagesJsonOnce( - process.env.UNI_INPUT_DIR, - process.env.UNI_PLATFORM - ) - const __uniConfig = { - globalStyle: { - rpxCalcMaxDeviceWidth: (globalStyle as any).rpxCalcMaxDeviceWidth, - rpxCalcBaseDeviceWidth: (globalStyle as any) - .rpxCalcBaseDeviceWidth, - }, - } - return content - .toString() - .replace( - '/*__uniConfig*/', - `var __uniConfig = ${JSON.stringify(__uniConfig)}` - ) - }, - }, - ], - hook: 'writeBundle', - verbose: process.env.DEBUG ? true : false, - }) -} diff --git a/packages/uni-app-vite/src/plugins/template.ts b/packages/uni-app-vite/src/plugins/template.ts new file mode 100644 index 0000000000..f47eeab112 --- /dev/null +++ b/packages/uni-app-vite/src/plugins/template.ts @@ -0,0 +1,56 @@ +import path from 'path' +import fs from 'fs-extra' +import { Plugin } from 'vite' + +import { parsePagesJsonOnce } from '@dcloudio/uni-cli-shared' + +function genViewHtml() { + const viewHtmlStr = fs.readFileSync( + path.resolve(__dirname, '../../lib/template/__uniappview.html'), + 'utf8' + ) + const { globalStyle } = parsePagesJsonOnce( + process.env.UNI_INPUT_DIR, + process.env.UNI_PLATFORM + ) + const __uniConfig = { + globalStyle: { + rpxCalcMaxDeviceWidth: (globalStyle as any).rpxCalcMaxDeviceWidth, + rpxCalcBaseDeviceWidth: (globalStyle as any).rpxCalcBaseDeviceWidth, + }, + } + return viewHtmlStr + .toString() + .replace( + '/*__uniConfig*/', + `var __uniConfig = ${JSON.stringify(__uniConfig)}` + ) +} + +export function uniTemplatePlugin(): Plugin { + return { + name: 'vite:uni-app-template', + configResolved() { + const outputDir = process.env.UNI_OUTPUT_DIR + return Promise.all([ + fs.copy( + require.resolve('@dcloudio/uni-app-plus/dist/uni-app-view.umd.js'), + path.resolve(outputDir, 'uni-app-view.umd.js'), + { + overwrite: true, + } + ), + fs + .copy(path.resolve(__dirname, '../../lib/template/'), outputDir, { + overwrite: true, + }) + .then(() => + fs.writeFile( + path.resolve(outputDir, '__uniappview.html'), + genViewHtml() + ) + ), + ]).then(() => {}) + }, + } +} diff --git a/packages/uni-cli-shared/package.json b/packages/uni-cli-shared/package.json index 0ac3c6e1d1..2bd7282fc9 100644 --- a/packages/uni-cli-shared/package.json +++ b/packages/uni-cli-shared/package.json @@ -20,9 +20,11 @@ }, "dependencies": { "@rollup/pluginutils": "^4.1.1", + "chokidar": "^3.5.2", "compare-versions": "^3.6.0", "debug": "^4.3.1", "estree-walker": "^2.0.2", + "fs-extra": "^10.0.0", "jsonc-parser": "^3.0.0", "merge": "^2.1.1", "rollup-plugin-copy": "^3.4.0", diff --git a/packages/uni-cli-shared/src/constants.ts b/packages/uni-cli-shared/src/constants.ts index 881c7077e3..7a949e84e5 100644 --- a/packages/uni-cli-shared/src/constants.ts +++ b/packages/uni-cli-shared/src/constants.ts @@ -25,3 +25,7 @@ export const COMMON_EXCLUDE = [ /\/@dcloudio\/uni-h5\/style/, /\/@dcloudio\/uni-components\/style/, ] + +export const TIPS_BUILD_COMPLETE = 'DONE Build complete.' +export const TIPS_WATCH_FOR_CHANGES = + TIPS_BUILD_COMPLETE + ' Watching for changes...' diff --git a/packages/uni-cli-shared/src/vite/index.ts b/packages/uni-cli-shared/src/vite/index.ts index 24d5a6218d..9b65a037bc 100644 --- a/packages/uni-cli-shared/src/vite/index.ts +++ b/packages/uni-cli-shared/src/vite/index.ts @@ -1,13 +1,13 @@ import type { Plugin } from 'vite' import type { ParserOptions } from '@vue/compiler-core' import type { CompilerOptions } from '@vue/compiler-sfc' -import type { Target } from 'rollup-plugin-copy' +import { UniViteCopyPluginOptions } from './plugins/copy' export interface CopyOptions { /** * 静态资源,配置的目录,在 uni_modules 中同样支持 */ assets?: string[] - targets?: readonly Target[] + targets?: UniViteCopyPluginOptions['targets'] } interface UniVitePluginUniOptions { diff --git a/packages/uni-cli-shared/src/vite/plugins/copy.ts b/packages/uni-cli-shared/src/vite/plugins/copy.ts index c96080b100..c75fd585ce 100644 --- a/packages/uni-cli-shared/src/vite/plugins/copy.ts +++ b/packages/uni-cli-shared/src/vite/plugins/copy.ts @@ -1,3 +1,60 @@ -import copy from 'rollup-plugin-copy' - -export const uniViteCopyPlugin = copy +import { Plugin, ResolvedConfig } from 'vite' +import { FileWatcher } from '../../watcher' +import { TIPS_WATCH_FOR_CHANGES } from '../../constants' +export interface UniViteCopyPluginTarget { + src: string | string[] + dest: string +} +export interface UniViteCopyPluginOptions { + targets: UniViteCopyPluginTarget[] + verbose: boolean +} +export function uniViteCopyPlugin({ + targets, + verbose, +}: UniViteCopyPluginOptions): Plugin { + let resolvedConfig: ResolvedConfig + let inited = false + return { + name: 'vite:uni-copy', + apply: 'build', + configResolved(config) { + resolvedConfig = config + }, + writeBundle() { + if (inited) { + return + } + if (resolvedConfig.build.ssr) { + return + } + inited = true + return new Promise((resolve) => { + Promise.all( + targets.map((target) => { + return new Promise((resolve) => { + new FileWatcher({ + verbose, + ...target, + }).watch( + { + cwd: process.env.UNI_INPUT_DIR, + }, + (watcher) => { + if (process.env.NODE_ENV !== 'development') { + watcher.close().then(() => resolve(void 0)) + } else { + resolve(void 0) + } + }, + () => { + console.log(TIPS_WATCH_FOR_CHANGES) + } + ) + }) + }) + ).then(() => resolve()) + }) + }, + } +} diff --git a/packages/uni-cli-shared/src/watcher.ts b/packages/uni-cli-shared/src/watcher.ts new file mode 100644 index 0000000000..67a7519528 --- /dev/null +++ b/packages/uni-cli-shared/src/watcher.ts @@ -0,0 +1,89 @@ +import fs from 'fs-extra' +import path from 'path' +import { FSWatcher, watch, WatchOptions } from 'chokidar' +interface FileWatcherOptions { + src: string | string[] + dest: string + verbose?: boolean +} + +export class FileWatcher { + private src: string[] + private dest: string + private verbose?: boolean + private watcher!: FSWatcher + private onChange?: () => void + constructor({ src, dest, verbose }: FileWatcherOptions) { + this.src = !Array.isArray(src) ? [src] : src + this.dest = dest + this.verbose = verbose + } + watch( + watchOptions: WatchOptions & { cwd: string }, + onReady?: (watcher: FSWatcher) => void, + onChange?: () => void + ) { + if (!this.watcher) { + const copy = this.copy.bind(this) + const remove = this.remove.bind(this) + this.watcher = watch(this.src, watchOptions) + .on('add', copy) + .on('addDir', copy) + .on('change', copy) + .on('unlink', remove) + .on('unlinkDir', remove) + .on('ready', () => { + onReady && onReady(this.watcher) + setTimeout(() => { + this.onChange = onChange + }, 1000) + }) + .on('error', (e) => console.error('watch', e)) + } + return this.watcher + } + add(paths: string | ReadonlyArray) { + this.info('add', paths) + return this.watcher.add(paths) + } + unwatch(paths: string | ReadonlyArray) { + this.info('unwatch', paths) + return this.watcher.unwatch(paths) + } + close() { + this.info('close') + return this.watcher.close() + } + copy(from: string) { + const to = this.to(from) + this.info('copy', from + '=>' + to) + return fs + .copy(this.from(from), to, { overwrite: true }) + .catch((e) => { + // this.info('copy', e) + }) + .then(() => this.onChange && this.onChange()) + } + remove(from: string) { + const to = this.to(from) + this.info('remove', from + '=>' + to) + return fs + .remove(to) + .catch((e) => { + // this.info('remove', e) + }) + .then(() => this.onChange && this.onChange()) + } + info( + type: 'close' | 'copy' | 'remove' | 'add' | 'unwatch', + msg?: string | unknown + ) { + this.verbose && console.log(type, msg) + } + from(from: string) { + return path.join(this.watcher.options.cwd!, from) + } + to(from: string) { + return path.join(this.dest, from) + } +} diff --git a/packages/vite-plugin-uni/src/cli/action.ts b/packages/vite-plugin-uni/src/cli/action.ts index 88cb0d6807..5e2b9e2cb9 100644 --- a/packages/vite-plugin-uni/src/cli/action.ts +++ b/packages/vite-plugin-uni/src/cli/action.ts @@ -1,6 +1,10 @@ import { extend } from '@vue/shared' import { RollupWatcher } from 'rollup' import { BuildOptions, ServerOptions } from 'vite' +import { + TIPS_BUILD_COMPLETE, + TIPS_WATCH_FOR_CHANGES, +} from '@dcloudio/uni-cli-shared' import { CliOptions } from '.' import { build, buildSSR } from './build' import { createServer, createSSRServer } from './server' @@ -17,7 +21,7 @@ export async function runDev(options: CliOptions & ServerOptions) { watcher.on('event', (event) => { if (event.code === 'BUNDLE_END') { event.result.close() - console.log(`DONE Build complete. Watching for changes...`) + console.log(TIPS_WATCH_FOR_CHANGES) } }) } @@ -33,7 +37,7 @@ export async function runBuild(options: CliOptions & BuildOptions) { await (options.ssr && options.platform === 'h5' ? buildSSR(options) : build(options)) - console.log(`DONE Build complete.`) + console.log(TIPS_BUILD_COMPLETE) } catch (e) { console.error(`error during build:\n${e.stack || e}`) process.exit(1) diff --git a/packages/vite-plugin-uni/src/configResolved/plugins/copy.ts b/packages/vite-plugin-uni/src/configResolved/plugins/copy.ts deleted file mode 100644 index 3bdb1b172d..0000000000 --- a/packages/vite-plugin-uni/src/configResolved/plugins/copy.ts +++ /dev/null @@ -1,52 +0,0 @@ -import path from 'path' -import { Plugin } from 'vite' - -import { - normalizePath, - PUBLIC_DIR, - uniViteCopyPlugin, -} from '@dcloudio/uni-cli-shared' -import { VitePluginUniResolvedOptions } from '../..' -import type { Target } from 'rollup-plugin-copy' - -export function uniCopyPlugin({ - inputDir, - outputDir, - copyOptions, -}: VitePluginUniResolvedOptions): Plugin { - const targets: Target[] = [ - { - src: normalizePath(path.resolve(inputDir, PUBLIC_DIR)), - dest: outputDir, - }, - { - src: normalizePath(path.resolve(inputDir, 'uni_modules/*/' + PUBLIC_DIR)), - dest: outputDir, - rename: (_name, _extension, fullPath) => { - return path.relative(inputDir, fullPath) - }, - }, - ] - copyOptions!.assets.forEach((asset) => { - targets.push({ - src: normalizePath(path.resolve(inputDir, asset)), - dest: outputDir, - rename: (_name, _extension, fullPath) => { - return path.relative(inputDir, fullPath) - }, - }) - targets.push({ - src: normalizePath(path.resolve(inputDir, 'uni_modules/*/' + asset)), - dest: outputDir, - rename: (_name, _extension, fullPath) => { - return path.relative(inputDir, fullPath) - }, - }) - }) - targets.push(...copyOptions!.targets) - return uniViteCopyPlugin({ - targets, - hook: 'writeBundle', - verbose: process.env.DEBUG ? true : false, - }) -} diff --git a/packages/vite-plugin-uni/src/configResolved/plugins/index.ts b/packages/vite-plugin-uni/src/configResolved/plugins/index.ts index ae86c279e5..42e775d6e1 100644 --- a/packages/vite-plugin-uni/src/configResolved/plugins/index.ts +++ b/packages/vite-plugin-uni/src/configResolved/plugins/index.ts @@ -11,7 +11,6 @@ import { uniJsonPlugin } from './json' import { uniPreCssPlugin } from './preCss' import { uniEasycomPlugin } from './easycom' -import { uniCopyPlugin } from './copy' import { uniStaticPlugin } from './static' import { uniRenderjsPlugin } from './renderjs' import { uniPreVuePlugin } from './preVue' @@ -44,7 +43,6 @@ export function initPlugins( config: ResolvedConfig, options: VitePluginUniResolvedOptions ) { - const command = config.command const plugins = config.plugins as Plugin[] addPlugin(plugins, uniResolveIdPlugin(options), 'vite:resolve', 'pre') @@ -78,10 +76,6 @@ export function initPlugins( addPlugin(plugins, uniJsonPlugin(options), 'vite:json', 'pre') addPlugin(plugins, uniStaticPlugin(options, config), 'vite:asset', 'pre') - if (command === 'build' && !config.build.ssr) { - addPlugin(plugins, uniCopyPlugin(options), plugins.length) - } - if (process.env.DEBUG) { debugPlugin(plugins.length) debugPlugin(plugins.map((p) => (p as Plugin).name)) diff --git a/packages/vite-plugin-uni/src/configureServer/easycom.ts b/packages/vite-plugin-uni/src/configureServer/easycom.ts index f6214e2f50..8a97667828 100644 --- a/packages/vite-plugin-uni/src/configureServer/easycom.ts +++ b/packages/vite-plugin-uni/src/configureServer/easycom.ts @@ -18,8 +18,8 @@ export const serveEasycom = ( if (!['add', 'unlink'].includes(eventName)) { return } - debugEasycom('watch', eventName, path) if (filter(path)) { + debugEasycom('watch', eventName, path) refreshEasycom() } }) diff --git a/packages/vite-plugin-uni/src/index.ts b/packages/vite-plugin-uni/src/index.ts index a1dde8658c..a1d0ab9822 100644 --- a/packages/vite-plugin-uni/src/index.ts +++ b/packages/vite-plugin-uni/src/index.ts @@ -16,6 +16,7 @@ import { import { createConfig } from './config' import { createConfigResolved } from './configResolved' import { createConfigureServer } from './configureServer' +import { uniCopyPlugin } from './plugins/copy' import { initExtraPlugins, initPluginUniOptions } from './utils' import { initPluginViteLegacyOptions, @@ -117,5 +118,12 @@ export default function uniPlugin( vuePlugin(initPluginVueOptions(options, uniPlugins, uniPluginOptions)) ) + plugins.push( + uniCopyPlugin({ + outputDir: process.env.UNI_OUTPUT_DIR, + copyOptions: options.copyOptions, + }) + ) + return plugins } diff --git a/packages/vite-plugin-uni/src/plugins/copy.ts b/packages/vite-plugin-uni/src/plugins/copy.ts new file mode 100644 index 0000000000..a7080149d9 --- /dev/null +++ b/packages/vite-plugin-uni/src/plugins/copy.ts @@ -0,0 +1,29 @@ +import { Plugin } from 'vite' + +import { + PUBLIC_DIR, + uniViteCopyPlugin, + UniViteCopyPluginTarget, +} from '@dcloudio/uni-cli-shared' +import { VitePluginUniResolvedOptions } from '..' + +export function uniCopyPlugin({ + outputDir, + copyOptions, +}: Pick): Plugin { + const assets = [PUBLIC_DIR + '/**/*', 'uni_modules/*/' + PUBLIC_DIR + '/**/*'] + copyOptions!.assets.forEach((asset) => { + assets.push(asset) + }) + const targets: UniViteCopyPluginTarget[] = [ + { + src: assets, + dest: outputDir, + }, + ] + targets.push(...copyOptions!.targets) + return uniViteCopyPlugin({ + targets, + verbose: process.env.DEBUG ? true : false, + }) +} diff --git a/packages/vite-plugin-uni/src/utils/plugin.ts b/packages/vite-plugin-uni/src/utils/plugin.ts index 481224245b..4d4ce75528 100644 --- a/packages/vite-plugin-uni/src/utils/plugin.ts +++ b/packages/vite-plugin-uni/src/utils/plugin.ts @@ -2,8 +2,11 @@ import path from 'path' import type { Plugin } from 'vite' import { extend, isArray, isString, isFunction } from '@vue/shared' import { isCustomElement, isNativeTag } from '@dcloudio/uni-shared' -import type { CopyOptions, UniVitePlugin } from '@dcloudio/uni-cli-shared' -import type { Target } from 'rollup-plugin-copy' +import type { + CopyOptions, + UniViteCopyPluginTarget, + UniVitePlugin, +} from '@dcloudio/uni-cli-shared' interface PluginConfig { id: string @@ -17,7 +20,7 @@ interface PluginConfig { export function initPluginUniOptions(UniVitePlugins: UniVitePlugin[]) { const assets: string[] = [] - const targets: Target[] = [] + const targets: UniViteCopyPluginTarget[] = [] const transformEvent: Record = Object.create(null) const compilerOptions: Required['uni']['compilerOptions'] = { isNativeTag, diff --git a/scripts/utils.js b/scripts/utils.js index 16a0a35c55..e1bf0d3264 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -9,6 +9,7 @@ const priority = { 'uni-mp-vue': 80, 'uni-mp-alipay': 70, 'uni-mp-baidu': 70, + 'uni-mp-kuaishou': 70, 'uni-mp-qq': 70, 'uni-mp-toutiao': 70, 'uni-mp-weixin': 70, diff --git a/yarn.lock b/yarn.lock index b632a9ea7f..c539adc3b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,9 +881,9 @@ regenerator-runtime "^0.13.4" "@babel/standalone@^7.14.9": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.15.0.tgz#451fb7f9ea799962c219cd90b6e6c11f08b777e8" - integrity sha512-x9LLp3oQPkNv57NyAVHIASLhGoNfHC6e7STARZhn48kCRw7ttmfgLm2tZzMMSpRlVs5OfvzHvG7tz5aXDE6FpA== + version "7.15.1" + resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.15.1.tgz#9b5e0852fa37c9e1408163b9be6e3ec1feb872a2" + integrity sha512-OJvIUtmXWEnTFvm+/TSMFkJK9vmbOF1wNmu/vbU18/Hlj9E6JdrkWxTkwbrsM1UjLtyb4w+pwZ/A1C4XZXorXg== "@babel/template@^7.0.0", "@babel/template@^7.14.5", "@babel/template@^7.3.3": version "7.14.5" @@ -2423,9 +2423,9 @@ integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== "@types/node@*": - version "16.4.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.12.tgz#961e3091f263e6345d2d84afab4e047a60b4b11b" - integrity sha512-zxrTNFl9Z8boMJXs6ieqZP0wAhvkdzmHSxTlJabM16cf5G9xBc1uPRH5Bbv2omEDDiM8MzTfqTJXBf0Ba4xFWA== + version "16.4.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.13.tgz#7dfd9c14661edc65cccd43a29eb454174642370d" + integrity sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg== "@types/node@10.17.13": version "10.17.13" @@ -2636,9 +2636,9 @@ hash-sum "^2.0.0" "@vitejs/plugin-vue@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.3.0.tgz#fc89a6c9b5a5157916afece4edc8fb55bf1bbc42" - integrity sha512-wJvuJdTBjvucUX0vK4fuy60t+A9bJSZxc59vp1Y+8kiOd0NU5kFt4lay72gMWPeR+lSUjrTmGUq8Uzb99Jbw3A== + version "1.4.0" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.4.0.tgz#962ae01b7fd16ad4007898c64ed639136e12215b" + integrity sha512-RkqfJHz9wdLKBp5Yi+kQL8BAljdrvPoccQm2PTZc/UcL4EjD11xsv2PPCduYx2oV1a/bpSKA3sD5sxOHFhz+LA== "@vue/babel-helper-vue-transform-on@^1.0.2": version "1.0.2" @@ -3053,7 +3053,7 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^3.0.3: +anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -3309,6 +3309,11 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + bl@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/bl/-/bl-0.8.2.tgz#c9b6bca08d1bc2ea00fc8afb4f1a5fd1e1c66e4e" @@ -3355,7 +3360,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -3597,6 +3602,21 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +chokidar@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -3641,9 +3661,9 @@ cjs-module-lexer@^1.0.0: integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== clean-css@^5.1.3: - version "5.1.4" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.1.4.tgz#d191c98347f9fc36b301f99bb827898151175782" - integrity sha512-e6JAuR0T2ahg7fOSv98Nxqh7mHWOac5TaCSgrr61h/6mkPLwlxX38hzob4h6IKj/UHlrrLXvAEjWqXlvi8r8lQ== + version "5.1.5" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.1.5.tgz#3b0af240dcfc9a3779a08c2332df3ebd4474f232" + integrity sha512-9dr/cU/LjMpU57PXlSvDkVRh0rPxJBXiBtD0+SgYt8ahTCsXtfKjCkNYgIoTC6mBg8CFr5EKhW3DKCaGMUbUfQ== dependencies: source-map "~0.6.0" @@ -4343,9 +4363,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.793: - version "1.3.796" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.796.tgz#bd74a4367902c9d432d129f265bf4542cddd9f54" - integrity sha512-agwJFgM0FUC1UPPbQ4aII3HamaaJ09fqWGAWYHmzxDWqdmTleCHyyA0kt3fJlTd5M440IaeuBfzXzXzCotnZcQ== + version "1.3.799" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.799.tgz#6e9911b25e7ecd5aa1e54dcb68f82a3e02d00f09" + integrity sha512-V2rbYWdGvSqrg+95KjkVuSi41bGfrhrOzjl1tSi2VLnm0mRe3FsSvhiqidSiSll9WiMhrQAhpDcW/wcqK3c+Yw== elliptic@^6.5.3: version "6.5.4" @@ -4476,9 +4496,9 @@ es-to-primitive@^1.2.1: is-symbol "^1.0.2" esbuild@^0.12.8: - version "0.12.17" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.17.tgz#5816f905c2905de0ebbc658860df7b5b48afbcd3" - integrity sha512-GshKJyVYUnlSXIZj/NheC2O0Kblh42CS7P1wJyTbbIHevTG4jYMS9NNw8EOd8dDWD0dzydYHS01MpZoUcQXB4g== + version "0.12.19" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.19.tgz#ab849766705a5093df5acd8ec2f6ba2159a38a6c" + integrity sha512-5NuT1G6THW7l3fsSCDkcPepn24R0XtyPjKoqKHD8LfhqMXzCdz0mrS9HgO6hIhzVT7zt0T+JGbzCqF5AH8hS9w== escalade@^3.1.1: version "3.1.1" @@ -4974,6 +4994,15 @@ fs-extra@8.1.0, fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^9.0.1, fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -5172,7 +5201,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.1.1, glob-parent@^5.1.2: +glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -5235,9 +5264,9 @@ globby@^11.0.2, globby@^11.0.3: slash "^3.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== handlebars@^4.7.6: version "4.7.7" @@ -5289,6 +5318,13 @@ has-symbols@^1.0.1, has-symbols@^1.0.2: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -5628,21 +5664,29 @@ is-arrayish@^0.2.1: integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-bigint@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" - integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.3.tgz#fc9d9e364210480675653ddaea0518528d49a581" + integrity sha512-ZU538ajmYJmzysE5yU4Y7uIrPQ2j704u+hXFiIPQExpqzzUbpe5jCPdTfmz7jXRxZdvjY3KZ3ZNenoXQovX+Dg== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" is-boolean-object@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" - integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-callable@^1.1.4, is-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== is-ci@^1.0.10: version "1.2.1" @@ -5673,9 +5717,11 @@ is-core-module@^2.1.0, is-core-module@^2.2.0: has "^1.0.3" is-date-object@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" - integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" is-extglob@^2.1.1: version "2.1.1" @@ -5704,7 +5750,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -5727,9 +5773,11 @@ is-negative-zero@^2.0.1: integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== is-number-object@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" - integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" is-number@^7.0.0: version "7.0.0" @@ -5791,12 +5839,12 @@ is-reference@^1.2.1: "@types/estree" "*" is-regex@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" - integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" - has-symbols "^1.0.2" + has-tostringtag "^1.0.0" is-regexp@^1.0.0: version "1.0.0" @@ -5821,9 +5869,11 @@ is-stream@^2.0.0: integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== is-string@^1.0.5, is-string@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" - integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" @@ -7421,7 +7471,7 @@ normalize-path@^1.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" integrity sha1-MtDkcvkf80VwHBWoMRAY07CpA3k= -normalize-path@^3.0.0: +normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== @@ -7947,7 +7997,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.2.2, picomatch@^2.2.3: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== @@ -8485,6 +8535,13 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -8747,9 +8804,9 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.2: estree-walker "^0.6.1" rollup@^2.35.1, rollup@^2.38.5: - version "2.55.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.55.1.tgz#66a444648e2fb603d8e329e77a61c608a6510fda" - integrity sha512-1P9w5fpb6b4qroePh8vHKGIvPNxwoCQhjJpIqfZGHLKpZ0xcU2/XBmFxFbc9697/6bmHpmFTLk5R1dAQhFSo0g== + version "2.56.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.0.tgz#daa832955d2b58f1ed52a3c4c85b7d1adaf076d0" + integrity sha512-weEafgbjbHCnrtJPNyCrhYnjP62AkF04P0BcV/1mofy1+gytWln4VVB1OK462cq2EAyWzRDpTMheSP/o+quoiA== optionalDependencies: fsevents "~2.3.2" @@ -9002,9 +9059,9 @@ slide@^1.1.6: integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= smart-buffer@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" - integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" + integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== socks-proxy-agent@^5.0.0: version "5.0.1" @@ -10008,9 +10065,9 @@ webpack-sources@^3.1.2, webpack-sources@^3.2.0: integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw== webpack@^5.1.0, webpack@^5.48.0: - version "5.48.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.48.0.tgz#06180fef9767a6fd066889559a4c4d49bee19b83" - integrity sha512-CGe+nfbHrYzbk7SKoYITCgN3LRAG0yVddjNUecz9uugo1QtYdiyrVD8nP1PhkNqPfdxC2hknmmKpP355Epyn6A== + version "5.49.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.49.0.tgz#e250362b781a9fb614ba0a97ed67c66b9c5310cd" + integrity sha512-XarsANVf28A7Q3KPxSnX80EkCcuOer5hTOEJWJNvbskOZ+EK3pobHarGHceyUZMxpsTHBHhlV7hiQyLZzGosYw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50" -- GitLab