ui: fix webpack js-yaml resolve

pull/148/head
undefined 3 years ago
parent d0569a6816
commit e4c6cf258d

@ -101,7 +101,11 @@ export default function (env = {}) {
resolve: {
modules: [root('node_modules'), root('../../node_modules')],
extensions: ['.js', '.jsx'],
alias: { vj: root() },
alias: {
vj: root(),
'js-yaml': root('utils/yamlCompact'),
'real-js-yaml': require.resolve('js-yaml'),
},
},
module: {
rules: [

@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.8.31",
"version": "4.8.32",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",

@ -1,4 +1,5 @@
import yaml from 'js-yaml';
import { getScoreColor } from '@hydrooj/utils/lib/status';
import * as echarts from 'echarts';
import { NamedPage } from 'vj/misc/Page';
import Navigation from 'vj/components/navigation';
@ -9,7 +10,6 @@ import delay from 'vj/utils/delay';
import i18n from 'vj/utils/i18n';
import request from 'vj/utils/request';
import base64 from 'vj/utils/base64';
import { getScoreColor } from 'vj/../utils/lib/status';
class ProblemPageExtender {
constructor() {

@ -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;
Loading…
Cancel
Save