Blog
首页
文档
收藏
关于
  • 在线转换时间戳 (opens new window)
  • 在线压缩图片 (opens new window)
  • Float-Double转二进制 (opens new window)
  • 文件转Hex字符串 (opens new window)

HiuZing

🍑
首页
文档
收藏
关于
  • 在线转换时间戳 (opens new window)
  • 在线压缩图片 (opens new window)
  • Float-Double转二进制 (opens new window)
  • 文件转Hex字符串 (opens new window)
  • 前端面试题

  • JavaScript

  • Vue2

  • port

  • CSS

  • Node.js

  • JavaScript优化

  • uniapp

  • Mini Program

  • TypeScript

  • 面向对象编程

  • UI组件

  • Plugin

  • Vue3

  • 性能优化

  • Axios

  • 状态管理

  • React

  • Mock

  • Icon

  • Template

  • 构建工具

  • 项目规范配置

  • Taro

    • 踩坑

    • 编译配置

      • 编译配置详情
        • alias
        • sass
  • SVG

  • React Native

  • 前端
  • Taro
  • 编译配置
HiuZing
2023-06-18
目录

编译配置详情

# alias

  1. 在tsconfig.json添加

    "paths": { "@/*": ["./src/*"] }
    
    1
  2. 在config/index.js添加

    alias: { '@': path.resolve(__dirname,'..','src') },
    
    1

    注意,这里面使用到了 nodejs 中内置的 path 模块,所以需要在顶部 引入path 模块

    import path from 'path';
    
    1
  3. 即可使用

# sass

配置全局样式

sass: {
  resource: path.resolve(__dirname, '..', 'src/styles/variable.scss')
}
1
2
3
上次更新: 2024/08/14, 04:14:33
Taro中使用canvas
SVG图标配置

← Taro中使用canvas SVG图标配置→

最近更新
01
React Native 使用SVG
08-13
02
Docker基础命令
08-04
03
算数逻辑单元
07-30
更多文章>
Theme by Vdoing | Copyright © 2021-2024 WeiXiaojing | 友情链接
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式