ui: ensure build cache

This commit is contained in:
undefined committed 2022-08-07 04:03:02 +08:00
1 parent da09cdbc84
commit 20bbda794e
2 files changed
+8 -3

No files matched your search

+2 -3
View File
@@ -35,10 +35,9 @@ jobs:
yarn.lock yarn.lock
.cache .cache
**/tsconfig.tsbuildinfo **/tsconfig.tsbuildinfo
key: ${{ github.ref }} key: cache-${{ github.ref }}
restore-keys: | restore-keys: |
master cache-
main
- name: Config And Install - name: Config And Install
run: | run: |
[[ ! -z "${{secrets.NPM_TOKEN}}" ]] && echo "npmAuthToken: ${{secrets.NPM_TOKEN}}" >> .yarnrc.yml [[ ! -z "${{secrets.NPM_TOKEN}}" ]] && echo "npmAuthToken: ${{secrets.NPM_TOKEN}}" >> .yarnrc.yml
@@ -82,6 +82,9 @@ export default function (env: { production?: boolean, measure?: boolean } = {})
type: 'filesystem', type: 'filesystem',
cacheDirectory: root('../../.cache'), cacheDirectory: root('../../.cache'),
idleTimeout: 30000, idleTimeout: 30000,
buildDependencies: {
config: [__filename],
},
}, },
output: { output: {
path: root('public'), path: root('public'),
@@ -236,6 +239,9 @@ export default function (env: { production?: boolean, measure?: boolean } = {})
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.VERSION': JSON.stringify(require('@hydrooj/ui-default/package.json').version), 'process.env.VERSION': JSON.stringify(require('@hydrooj/ui-default/package.json').version),
}), }),
new webpack.optimize.MinChunkSizePlugin({
minChunkSize: 128000,
}),
new webpack.NormalModuleReplacementPlugin(/\/(vscode-)?nls\.js/, require.resolve('../../components/monaco/nls')), new webpack.NormalModuleReplacementPlugin(/\/(vscode-)?nls\.js/, require.resolve('../../components/monaco/nls')),
new MonacoWebpackPlugin({ new MonacoWebpackPlugin({
filename: '[name].[hash:10].worker.js', filename: '[name].[hash:10].worker.js',