V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
IndieCreator
V2EX  ›  React

React 项目, Tailwind css docker 打包部署后失效, 本文 WebStorm 运行正常

  •  
  •   IndieCreator · 17 天前 · 915 次点击

    请教下我是哪里写错了吗

    项目中的 tailwind

    Imgur

    docker 的写法:

    Imgur

    2 条回复    2024-09-20 12:14:55 +08:00
    gaeco
        1
    gaeco  
       16 天前
    你没把 tailwind 打进去,正确的思路是这样
    WORKDIR /app/frontend

    COPY frontend/package.json frontend/package-lock.json ./
    RUN npm install tailwindcss postcss-cli --save-dev

    COPY frontend/public/ ./public
    COPY frontend/src/ ./src

    COPY frontend/tailwind.config.js ./tailwind.config.js
    COPY frontend/postcss.config.js ./postcss.config.js

    然后运行 npm install

    你可以参考改一下
    IndieCreator
        2
    IndieCreator  
    OP
       16 天前
    @gaeco 嗯嗯,谢谢,我试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1706 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 00:24 · PVG 08:24 · LAX 17:24 · JFK 20:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.