代码拉取完成,页面将自动刷新
const path = require("path");
const resolve = (dir) => path.resolve(__dirname, dir);
const sassResourcesLoader = require("craco-sass-resources-loader");
module.exports = {
style: {
sass: {
loaderOptions: {
sourceMap: true,
},
},
},
plugins: [
{
plugin: sassResourcesLoader,
options: {
resources: "./src/assets/css/index.scss",
},
},
],
webpack: {
alias: {
"@": resolve("src"),
assets: resolve("src/assets"),
common: resolve("src/common"),
components: resolve("src/components"),
router: resolve("src/router"),
services: resolve("src/services"),
store: resolve("src/store"),
views: resolve("src/views"),
utils: resolve("src/utils"),
},
},
// devServer: {
// host: 'localhost',//target host
// port: 5000,
// proxy: {
// [process.env.REACT_APP_API]: {
// target: `${process.env.REACT_APP_BASE_URL}`, //配置你要请求的服务器地址
// changeOrigin: true,
// pathRewrite: {
// [`^${process.env.REACT_APP_API}`]: "",
// },
// },
// },
// },
devServer: {
//这里用变量直接报错
host: "localhost", //target host
port: 5000,
proxy: {
"/devApi": {
target: "http://www.web-jshtml.cn/api/react", //配置你要请求的服务器地址
changeOrigin: true,
pathRewrite: {
"/devApi": "",
},
},
},
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。