Skip to content

Commit

Permalink
fix: fix npm script
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 16, 2020
1 parent 8a1bfdf commit b84de1a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build/plugin/gzip/compress.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { gzip } from 'zlib';
import { readFileSync, writeFileSync } from 'fs';
import { GzipPluginOptions } from './types';
import viteConfig from '../../vite.config';
import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../utils';
import viteConfig from '../../../vite.config';
import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../../utils';

export function startGzip(
fileContent: string | Buffer,
Expand Down
8 changes: 4 additions & 4 deletions build/script/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { argv } from 'yargs';
import { runChangeLog } from './changelog';
import { runPostInstall } from './postinstall';
import { runPreview } from './preview';
import { runPreserve } from './preserve';
// import { runPreserve } from './preserve';
import { runBuild } from './build';

const task = (argv._ || [])[0];
Expand All @@ -23,9 +23,9 @@ switch (task) {
runBuild();
break;

case 'preserve':
runPreserve();
break;
// case 'preserve':
// runPreserve();
// break;

case 'postinstall':
runPostInstall();
Expand Down
2 changes: 2 additions & 0 deletions build/script/preserve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ export async function runPreserve() {
} catch (error) {}
}
}

runPreserve();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0-rc.1",
"scripts": {
"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:site": "cross-env SITE=true npm run build ",
"build:no-cache": "yarn clean:cache && npm run build",
Expand Down
12 changes: 5 additions & 7 deletions src/components/Transition/src/ExpandTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,22 @@ export default function (expandedParentClass = '', x = false) {

enter(el: HTMLExpandElement) {
const initialStyle = el._initialStyle;
const offset = `${el[offsetProperty]}px`;

el.style.setProperty('transition', 'none', 'important');
el.style.visibility = 'hidden';
el.style.visibility = initialStyle.visibility!;
// Hide overflow to account for collapsed margins in the calculated height
el.style.overflow = 'hidden';
const offset = `${el[offsetProperty]}px`;

el.style[sizeProperty] = '0';
/* eslint-disable-next-line */

void el.offsetHeight; // force reflow

el.style.transition = initialStyle.transition;

if (expandedParentClass && el._parent) {
el._parent.classList.add(expandedParentClass);
}
console.log('======================');
console.log(sizeProperty, offset);
console.log('======================');

requestAnimationFrame(() => {
el.style[sizeProperty] = offset;
});
Expand Down

0 comments on commit b84de1a

Please sign in to comment.