Skip to content

Commit

Permalink
chore: 更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxb committed Jul 7, 2022
1 parent 94670dd commit 9ef7d0b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 56 deletions.
43 changes: 21 additions & 22 deletions packages/genesis-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,50 @@
"license": "MIT",
"gitHead": "f7052f0194c66eb24c56f2d5cabd5cb0d9ffe52d",
"dependencies": {
"@babel/core": "7.17.5",
"@babel/plugin-proposal-class-properties": "7.16.7",
"@babel/plugin-proposal-decorators": "7.17.2",
"@babel/plugin-proposal-export-default-from": "7.16.7",
"@babel/plugin-syntax-jsx": "7.16.7",
"@babel/plugin-transform-modules-commonjs": "7.16.8",
"@babel/plugin-transform-runtime": "7.17.0",
"@babel/preset-env": "7.16.11",
"@babel/runtime": "7.17.2",
"@types/node": "17.0.21",
"@babel/core": "7.18.6",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.18.6",
"@babel/plugin-proposal-export-default-from": "7.18.6",
"@babel/plugin-syntax-jsx": "7.18.6",
"@babel/plugin-transform-modules-commonjs": "7.18.6",
"@babel/plugin-transform-runtime": "7.18.6",
"@babel/preset-env": "7.18.6",
"@babel/runtime": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@types/node": "18.0.3",
"babel-helper-vue-jsx-merge-props": "2.0.3",
"babel-loader": "8.2.3",
"babel-loader": "8.2.5",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-vue-jsx": "3.7.0",
"babel-preset-typescript-vue": "1.1.1",
"chalk": "^4.1.0",
"core-js": "3.21.1",
"core-js": "3.23.3",
"css-loader": "6.7.1",
"cssnano": "5.1.1",
"cssnano": "5.1.12",
"fflate": "0.7.3",
"file-loader": "6.2.0",
"find": "0.3.0",
"html-minifier": "4.0.0",
"less": "4.1.2",
"less": "4.1.3",
"less-loader": "10.2.0",
"mini-css-extract-plugin": "2.6.0",
"mini-css-extract-plugin": "2.6.1",
"mkdirp": "1.0.4",
"postcss": "8.4.8",
"postcss": "8.4.14",
"postcss-loader": "6.2.1",
"postcss-preset-env": "7.4.2",
"relative": "3.0.2",
"sass-loader": "12.6.0",
"style-loader": "3.3.1",
"thread-loader": "3.0.4",
"ts-node": "10.7.0",
"typescript": "4.6.3",
"ts-node": "10.8.2",
"typescript": "4.7.4",
"upath": "2.0.1",
"vue-loader": "^15.10.0",
"vue-server-renderer": "^2.7.3",
"vue-style-loader": "4.1.3",
"vue-tsc": "0.38.2",
"webpack": "5.70.0",
"webpack": "5.73.0",
"webpack-bundle-analyzer": "4.5.0",
"webpack-chain": "6.5.1",
"webpack-dev-middleware": "5.3.0",
"webpack-dev-middleware": "5.3.3",
"webpack-hot-middleware": "2.25.1",
"webpackbar": "5.0.2",
"worker-loader": "3.0.8",
Expand Down
26 changes: 9 additions & 17 deletions packages/genesis-compiler/src/plugins/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,35 @@ export class BabelPlugin extends Plugin {
}
]
];
const presetsTS = [
[
'babel-preset-typescript-vue',
{
allowNamespaces: true
}
],
...presets
];
const babeljs: BabelConfig = {
const presetsTS = [['@babel/preset-typescript'], ...presets];
const babelJS: BabelConfig = {
target,
plugins: [...plugins],
presets: [...presets]
};
const babelts: BabelConfig = {
const babelTS: BabelConfig = {
target,
plugins: [...plugins],
presets: presetsTS
};
Object.defineProperty(babeljs, 'target', {
Object.defineProperty(babelJS, 'target', {
writable: false,
enumerable: false
});
Object.defineProperty(babelts, 'target', {
Object.defineProperty(babelTS, 'target', {
writable: false,
enumerable: false
});
await this.ssr.plugin.callHook('babel', babeljs);
await this.ssr.plugin.callHook('babel', babelts);
await this.ssr.plugin.callHook('babel', babelJS);
await this.ssr.plugin.callHook('babel', babelTS);
const jsRule = config.module
.rule('js')
.test(/\.m?jsx?$/)
.include.add(this.ssr.srcIncludes)
.end()
.use('babel')
.loader('babel-loader')
.options(babeljs)
.options(babelJS)
.end();
config.module
.rule('ts')
Expand All @@ -76,7 +68,7 @@ export class BabelPlugin extends Plugin {
.end()
.use('babel')
.loader('babel-loader')
.options(babelts)
.options(babelTS)
.end();
if (isProd) {
jsRule.use('thread-loader').loader('thread-loader').end();
Expand Down
20 changes: 3 additions & 17 deletions packages/genesis-compiler/src/webpack/watch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MF, Renderer, SSR } from '@fmfe/genesis-core';
import chalk from 'chalk';
import { Renderer, SSR } from '@fmfe/genesis-core';
import fs from 'fs';
import mkdirp from 'mkdirp';
import path from 'path';
Expand All @@ -10,8 +9,6 @@ import WebpackHotMiddleware from 'webpack-hot-middleware';
import { InstallPlugin } from '../plugins/install';
import { BaseGenesis } from '../utils';
import { ClientConfig, ServerConfig } from '../webpack';
const error = chalk.bold.red;
const warning = chalk.keyword('orange');

export class WatchClientConfig extends ClientConfig {
public constructor(ssr: SSR) {
Expand Down Expand Up @@ -49,10 +46,10 @@ export class Watch extends BaseGenesis {
}

public async start() {
let ready: Function;
let ready: Function | null;
let clientDone = false;
let serverDone = false;
let promise = new Promise<void>((resolve) => {
let promise: Promise<void> | null = new Promise<void>((resolve) => {
ready = resolve;
});
const onReady = () => {
Expand Down Expand Up @@ -88,17 +85,6 @@ export class Watch extends BaseGenesis {
poll: 1000
};
const clientOnDone = (stats: Webpack.Stats) => {
const jsonStats = stats.toJson();
if (stats.hasErrors()) {
jsonStats.errors.forEach((err) =>
console.log(error(err.message))
);
}
if (stats.hasWarnings()) {
jsonStats.warnings.forEach((err) =>
console.log(warning(err.message))
);
}
if (stats.hasErrors()) return;
this.notify();
clientDone = true;
Expand Down
1 change: 1 addition & 0 deletions packages/genesis-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export = Genesis;

declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
// @ts-ignore
renderContext?: Genesis.RenderContext;
clientOptions?: Genesis.ClientOptions;
}
Expand Down

0 comments on commit 9ef7d0b

Please sign in to comment.