mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: add service worker to cache resources (#445)
This commit is contained in:
1 parent
aa5df5346a
commit
fcc4eedd9f
10 files changed
+112
-54
No files matched your search
@@ -9,6 +9,7 @@ import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
|
||||
import { dirname } from 'path';
|
||||
import webpack from 'webpack';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
|
||||
import WebpackBar from 'webpackbar';
|
||||
import root from '../utils/root';
|
||||
|
||||
@@ -18,7 +19,7 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
|
||||
loader: 'esbuild-loader',
|
||||
options: {
|
||||
loader: 'tsx',
|
||||
target: 'es2015',
|
||||
target: 'chrome80',
|
||||
sourcemap: true,
|
||||
},
|
||||
};
|
||||
@@ -220,7 +221,7 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
|
||||
minifyIdentifiers: true,
|
||||
treeShaking: true,
|
||||
target: [
|
||||
'chrome60',
|
||||
'chrome80',
|
||||
],
|
||||
exclude: [/mathmaps/, /\.min\.js$/],
|
||||
})],
|
||||
@@ -240,8 +241,9 @@ export default function (env: { watch?: boolean, production?: boolean, measure?:
|
||||
new ExtractCssPlugin({
|
||||
filename: '[name].css?[fullhash:6]',
|
||||
}),
|
||||
new WebpackManifestPlugin({}),
|
||||
new FriendlyErrorsPlugin(),
|
||||
new webpack.IgnorePlugin({ resourceRegExp: /(^\.\/locale$|mathjax|abcjs)/ }),
|
||||
new webpack.IgnorePlugin({ resourceRegExp: /(^\.\/locale$|mathjax|abcjs|vditor.+\.d\.ts)/ }),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: root('static') },
|
||||
|
||||
Reference in new issue
Block a user