feat: disable webpack

This commit is contained in:
fly6516 2024-12-30 16:10:33 +08:00
parent 46493cf1b4
commit d3811fb363

View File

@ -3,27 +3,27 @@
import { useState } from 'react'; import { useState } from 'react';
import { runCode } from '@/actions'; // 导入 Server Action import { runCode } from '@/actions'; // 导入 Server Action
import './styles.css'; // 引入样式 // import './styles.css'; // 引入样式
//
const root = document.getElementById('root'); // const root = document.getElementById('root');
if (root) { // if (root) {
root.innerHTML = 'Hello, world!'; // root.innerHTML = 'Hello, world!';
} // }
//
/// <reference types="webpack-env" /> // /// <reference types="webpack-env" />
//
if (module.hot) { // if (module.hot) {
module.hot.accept(() => { // module.hot.accept(() => {
console.log('HMR is working!'); // console.log('HMR is working!');
}); // });
} // }
//
// 启用 HMR // // 启用 HMR
if (module.hot) { // if (module.hot) {
module.hot.accept('./styles.css', () => { // module.hot.accept('./styles.css', () => {
console.log('CSS updated!'); // console.log('CSS updated!');
}); // });
} // }
const CodeRunner = () => { const CodeRunner = () => {