mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: add sourcemap and version string
This commit is contained in:
1 parent
34aa867672
commit
e9e2695fdd
5 files changed
+7
-1
No files matched your search
@@ -81,6 +81,7 @@ export default function (env = {}) {
|
||||
mode: (env.production || env.measure) ? 'production' : 'development',
|
||||
profile: true,
|
||||
context: root(),
|
||||
devtool: env.production ? 'source-map' : 'eval-source-map',
|
||||
entry: {
|
||||
hydro: './entry.js',
|
||||
polyfill: './polyfill.ts',
|
||||
@@ -211,6 +212,7 @@ export default function (env = {}) {
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: env.production ? '"production"' : '"debug"',
|
||||
VERSION: JSON.stringify(require('@hydrooj/ui-default/package.json').version),
|
||||
},
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
|
||||
@@ -94,6 +94,8 @@ async function main() {
|
||||
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
||||
const files = fs.readdirSync('public');
|
||||
files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`));
|
||||
}
|
||||
}
|
||||
process.chdir(dir);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { sortBy } from 'lodash';
|
||||
import request from 'vj/utils/request';
|
||||
import Notification from 'vj/components/notification';
|
||||
|
||||
export default class ObjectiveContainer extends React.PureComponent {
|
||||
constructor(args) {
|
||||
|
||||
@@ -4,6 +4,7 @@ window.Hydro = {
|
||||
components: {},
|
||||
utils: {},
|
||||
node_modules: {},
|
||||
version: process.env.VERSION,
|
||||
};
|
||||
window.externalModules = {};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.35.3",
|
||||
"version": "4.35.4",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
Reference in new issue
Block a user