mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: use broadcast channel to handle message update
This commit is contained in:
1 parent
27056c5b69
commit
87b980f87d
7 files changed
+133
-139
No files matched your search
@@ -206,7 +206,6 @@ export default function (env = {}) {
|
||||
{ from: root('static') },
|
||||
{ from: root(`${dirname(require.resolve('vditor/package.json'))}/dist`), to: 'vditor/dist' },
|
||||
{ from: `${dirname(require.resolve('monaco-themes/package.json'))}/themes`, to: 'monaco/themes/' },
|
||||
{ from: root('.build/sharedworker.js'), to: 'sharedworker.js' },
|
||||
],
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import webpack from 'webpack';
|
||||
import esbuild from 'esbuild';
|
||||
import WebpackDevServer from 'webpack-dev-server';
|
||||
import gulp from 'gulp';
|
||||
import log from 'fancy-log';
|
||||
@@ -18,15 +17,6 @@ const argv = cac().parse();
|
||||
async function runWebpack({
|
||||
watch, production, measure, dev,
|
||||
}) {
|
||||
const result = esbuild.build({
|
||||
bundle: true,
|
||||
format: 'iife',
|
||||
entryPoints: [root('sharedworker.ts')],
|
||||
outfile: root('.build/sharedworker.js'),
|
||||
watch: dev || watch,
|
||||
minify: production,
|
||||
});
|
||||
if (!dev && !watch) await result;
|
||||
const compiler = webpack(webpackConfig({ watch, production, measure }));
|
||||
if (dev) {
|
||||
const server = new WebpackDevServer(compiler, {
|
||||
@@ -36,7 +26,7 @@ async function runWebpack({
|
||||
stats: 'none',
|
||||
index: root('public'),
|
||||
proxy: {
|
||||
context: (path) => !path.includes('sharedworker.js'),
|
||||
context: (path) => !path.includes('sockjs-node'),
|
||||
target: 'http://localhost:2333',
|
||||
ws: true,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user