mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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',
|
mode: (env.production || env.measure) ? 'production' : 'development',
|
||||||
profile: true,
|
profile: true,
|
||||||
context: root(),
|
context: root(),
|
||||||
|
devtool: env.production ? 'source-map' : 'eval-source-map',
|
||||||
entry: {
|
entry: {
|
||||||
hydro: './entry.js',
|
hydro: './entry.js',
|
||||||
polyfill: './polyfill.ts',
|
polyfill: './polyfill.ts',
|
||||||
@@ -211,6 +212,7 @@ export default function (env = {}) {
|
|||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: env.production ? '"production"' : '"debug"',
|
NODE_ENV: env.production ? '"production"' : '"debug"',
|
||||||
|
VERSION: JSON.stringify(require('@hydrooj/ui-default/package.json').version),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
new webpack.LoaderOptionsPlugin({
|
new webpack.LoaderOptionsPlugin({
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ async function main() {
|
|||||||
fs.removeSync('public/vditor/dist/js/graphviz');
|
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||||
fs.removeSync('public/vditor/dist/js/mermaid');
|
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
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);
|
process.chdir(dir);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { sortBy } from 'lodash';
|
import { sortBy } from 'lodash';
|
||||||
import request from 'vj/utils/request';
|
import request from 'vj/utils/request';
|
||||||
|
import Notification from 'vj/components/notification';
|
||||||
|
|
||||||
export default class ObjectiveContainer extends React.PureComponent {
|
export default class ObjectiveContainer extends React.PureComponent {
|
||||||
constructor(args) {
|
constructor(args) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ window.Hydro = {
|
|||||||
components: {},
|
components: {},
|
||||||
utils: {},
|
utils: {},
|
||||||
node_modules: {},
|
node_modules: {},
|
||||||
|
version: process.env.VERSION,
|
||||||
};
|
};
|
||||||
window.externalModules = {};
|
window.externalModules = {};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.35.3",
|
"version": "4.35.4",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user