ui: fix webpack js-yaml resolve

This commit is contained in:
undefined committed 2021-05-20 22:16:22 +08:00
1 parent d0569a6816
commit e4c6cf258d
4 files changed
+15 -3

No files matched your search

+5 -1
View File
@@ -101,7 +101,11 @@ export default function (env = {}) {
resolve: { resolve: {
modules: [root('node_modules'), root('../../node_modules')], modules: [root('node_modules'), root('../../node_modules')],
extensions: ['.js', '.jsx'], extensions: ['.js', '.jsx'],
alias: { vj: root() }, alias: {
vj: root(),
'js-yaml': root('utils/yamlCompact'),
'real-js-yaml': require.resolve('js-yaml'),
},
}, },
module: { module: {
rules: [ rules: [
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.8.31", "version": "4.8.32",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -1,4 +1,5 @@
import yaml from 'js-yaml'; import yaml from 'js-yaml';
import { getScoreColor } from '@hydrooj/utils/lib/status';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { NamedPage } from 'vj/misc/Page'; import { NamedPage } from 'vj/misc/Page';
import Navigation from 'vj/components/navigation'; import Navigation from 'vj/components/navigation';
@@ -9,7 +10,6 @@ import delay from 'vj/utils/delay';
import i18n from 'vj/utils/i18n'; import i18n from 'vj/utils/i18n';
import request from 'vj/utils/request'; import request from 'vj/utils/request';
import base64 from 'vj/utils/base64'; import base64 from 'vj/utils/base64';
import { getScoreColor } from 'vj/../utils/lib/status';
class ProblemPageExtender { class ProblemPageExtender {
constructor() { constructor() {
+8
View File
@@ -0,0 +1,8 @@
// eslint-disable-next-line import/no-unresolved
import yaml, { Schema } from 'real-js-yaml';
Schema.create = (arg1, arg2) => new Schema(arg1, arg2);
// eslint-disable-next-line import/no-unresolved
export * from 'real-js-yaml';
export default yaml;