Gulp 顺风与php文件

ej83mcc0  于 5个月前  发布在  Gulp
关注(0)|答案(1)|浏览(51)

我有一个项目,由css,js,php文件组成。
Css和js文件位于/src文件夹中,php文件位于项目的根文件夹中。
我想在这个项目中使用tailwind和gulp,并在dist文件夹中准备好tailwind样式。但由于某些原因,tailwind不会为php文件生成样式。
所以当我运行- npm run dev时,我看到了html、scss、js文件的样式,但没有看到php文件的样式。
tailwind.config.js

/** @type {import('tailwindcss').Config} */

export default {
  content: [
    './src/**/*.{html,scss,js}', 
    './*.{php}'
  ],
  theme: { ...

字符串
gulpfile.js

import { copy } from './gulp/tasks/copy.js';
import { copyRootFiles } from './gulp/tasks/copyRootFiles.js';
import { reset } from './gulp/tasks/reset.js';
import { html } from './gulp/tasks/html.js';
import { server } from './gulp/tasks/server.js';
import { scss } from './gulp/tasks/scss.js';
import { js } from './gulp/tasks/js.js';
import { images } from './gulp/tasks/images.js';
import { otfToTtf, ttfToWoff, fontStyle } from './gulp/tasks/fonts.js';
import { svgSprive } from './gulp/tasks/svgSprive.js';
import { zip } from './gulp/tasks/zip.js';
import { ftp } from './gulp/tasks/ftp.js';

global.app = {
  isBuild: process.argv.includes('--build'),
  isDev: !process.argv.includes('--build'),
  path: filePaths,
  gulp,
  plugins,
};

function watcher() {
  gulp.watch(filePaths.watch.static, copy);
  gulp.watch(filePaths.watch.html, html);
  gulp.watch(filePaths.watch.html, scss);
  gulp.watch(filePaths.watch.scss, scss);
  gulp.watch(filePaths.watch.js, js);
  gulp.watch(filePaths.watch.js, scss);
  gulp.watch(filePaths.watch.images, images);
  gulp.watch(filePaths.watch.php, scss);
}


我试试这个
tailwind.config.js

/** @type {import('tailwindcss').Config} */

export default {
  content: [
    './src/**/*.{html,scss,js}', 
    './*.{php}'
  ],
  theme: {


但它不适用于php文件

evrscar2

evrscar21#

你试过:

npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch

字符串
https://tailwindcss.com/docs/installation
这可能有助于集成:https://tailwindcss.com/docs/installation/using-postcss

相关问题