IndieCreator
V2EX  ›  React

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

  •  
  •   IndieCreator · Sep 19, 2024 · 2468 views
    This topic created in 610 days ago, the information mentioned may be changed or developed.

    请教下我是哪里写错了吗

    项目中的 tailwind

    Imgur

    docker 的写法:

    Imgur

    2 replies    2024-09-20 12:14:55 +08:00
    gaeco
        1
    gaeco  
       Sep 20, 2024
    你没把 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
       Sep 20, 2024
    @gaeco 嗯嗯,谢谢,我试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:18 · PVG 06:18 · LAX 15:18 · JFK 18:18
    ♥ Do have faith in what you're doing.