- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL - 修复 HomePage.tsx 中所有图片引用 - 修复 CoursePage.tsx 中所有图片引用 - 确保图片在 GitHub Pages 上正确加载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
1.3 KiB
JavaScript
29 lines
1.3 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const os_1 = __importDefault(require("os"));
|
|
const chalk_1 = __importDefault(require("chalk"));
|
|
const path_1 = __importDefault(require("path"));
|
|
const issue_1 = require("../issue");
|
|
const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
|
|
function createWebpackFormatter(formatter) {
|
|
// mimics webpack error formatter
|
|
return function webpackFormatter(issue) {
|
|
const color = issue.severity === 'warning' ? chalk_1.default.yellow.bold : chalk_1.default.red.bold;
|
|
const severity = issue.severity.toUpperCase();
|
|
if (issue.file) {
|
|
let location = forwardSlash_1.default(path_1.default.relative(process.cwd(), issue.file));
|
|
if (issue.location) {
|
|
location += `:${issue_1.formatIssueLocation(issue.location)}`;
|
|
}
|
|
return [color(`${severity} in ${location}`), formatter(issue), ''].join(os_1.default.EOL);
|
|
}
|
|
else {
|
|
return [color(`${severity} in `) + formatter(issue), ''].join(os_1.default.EOL);
|
|
}
|
|
};
|
|
}
|
|
exports.createWebpackFormatter = createWebpackFormatter;
|