mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 02:00:25 +08:00
fix: fix npm script
This commit is contained in:
parent
8a1bfdf13d
commit
b84de1a515
@ -1,8 +1,8 @@
|
|||||||
import { gzip } from 'zlib';
|
import { gzip } from 'zlib';
|
||||||
import { readFileSync, writeFileSync } from 'fs';
|
import { readFileSync, writeFileSync } from 'fs';
|
||||||
import { GzipPluginOptions } from './types';
|
import { GzipPluginOptions } from './types';
|
||||||
import viteConfig from '../../vite.config';
|
import viteConfig from '../../../vite.config';
|
||||||
import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../utils';
|
import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../../utils';
|
||||||
|
|
||||||
export function startGzip(
|
export function startGzip(
|
||||||
fileContent: string | Buffer,
|
fileContent: string | Buffer,
|
||||||
|
@ -6,7 +6,7 @@ import { argv } from 'yargs';
|
|||||||
import { runChangeLog } from './changelog';
|
import { runChangeLog } from './changelog';
|
||||||
import { runPostInstall } from './postinstall';
|
import { runPostInstall } from './postinstall';
|
||||||
import { runPreview } from './preview';
|
import { runPreview } from './preview';
|
||||||
import { runPreserve } from './preserve';
|
// import { runPreserve } from './preserve';
|
||||||
import { runBuild } from './build';
|
import { runBuild } from './build';
|
||||||
|
|
||||||
const task = (argv._ || [])[0];
|
const task = (argv._ || [])[0];
|
||||||
@ -23,9 +23,9 @@ switch (task) {
|
|||||||
runBuild();
|
runBuild();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'preserve':
|
// case 'preserve':
|
||||||
runPreserve();
|
// runPreserve();
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case 'postinstall':
|
case 'postinstall':
|
||||||
runPostInstall();
|
runPostInstall();
|
||||||
|
@ -69,3 +69,5 @@ export async function runPreserve() {
|
|||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runPreserve();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "2.0.0-rc.1",
|
"version": "2.0.0-rc.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "yarn install",
|
"bootstrap": "yarn install",
|
||||||
"serve": "node ./build/jsc.ts preserve && cross-env NODE_ENV=development vite",
|
"serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite",
|
||||||
"build": "node ./build/jsc.ts build",
|
"build": "node ./build/jsc.ts build",
|
||||||
"build:site": "cross-env SITE=true npm run build ",
|
"build:site": "cross-env SITE=true npm run build ",
|
||||||
"build:no-cache": "yarn clean:cache && npm run build",
|
"build:no-cache": "yarn clean:cache && npm run build",
|
||||||
|
@ -33,14 +33,14 @@ export default function (expandedParentClass = '', x = false) {
|
|||||||
|
|
||||||
enter(el: HTMLExpandElement) {
|
enter(el: HTMLExpandElement) {
|
||||||
const initialStyle = el._initialStyle;
|
const initialStyle = el._initialStyle;
|
||||||
const offset = `${el[offsetProperty]}px`;
|
|
||||||
|
|
||||||
el.style.setProperty('transition', 'none', 'important');
|
el.style.setProperty('transition', 'none', 'important');
|
||||||
el.style.visibility = 'hidden';
|
// Hide overflow to account for collapsed margins in the calculated height
|
||||||
el.style.visibility = initialStyle.visibility!;
|
|
||||||
el.style.overflow = 'hidden';
|
el.style.overflow = 'hidden';
|
||||||
|
const offset = `${el[offsetProperty]}px`;
|
||||||
|
|
||||||
el.style[sizeProperty] = '0';
|
el.style[sizeProperty] = '0';
|
||||||
/* eslint-disable-next-line */
|
|
||||||
void el.offsetHeight; // force reflow
|
void el.offsetHeight; // force reflow
|
||||||
|
|
||||||
el.style.transition = initialStyle.transition;
|
el.style.transition = initialStyle.transition;
|
||||||
@ -48,9 +48,7 @@ export default function (expandedParentClass = '', x = false) {
|
|||||||
if (expandedParentClass && el._parent) {
|
if (expandedParentClass && el._parent) {
|
||||||
el._parent.classList.add(expandedParentClass);
|
el._parent.classList.add(expandedParentClass);
|
||||||
}
|
}
|
||||||
console.log('======================');
|
|
||||||
console.log(sizeProperty, offset);
|
|
||||||
console.log('======================');
|
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
el.style[sizeProperty] = offset;
|
el.style[sizeProperty] = offset;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user