定制 fastfony/tailwind-webpack-encore-pack 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fastfony/tailwind-webpack-encore-pack

最新稳定版本:v1.0.0

Composer 安装命令:

composer require fastfony/tailwind-webpack-encore-pack

包简介

Tailwind Support for Symfony + Webpack Encore

README 文档

README

Latest Stable Version Total Downloads License

This pack makes it easy to use Tailwind CSS with Symfony's Webpack Encore Bundle.

If you don't use Symfony Flex, its interest is limited to requiring necessary packages but you must configure your project files manually.

It's an implementation of the tutorial available on the Tailwind CSS site.

Note

Want to use Tailwind CSS with AssetMapper Component instead? Check out the TailwindBundle Docs.

Installation

Install the pack & configure your app with three commands:

composer require fastfony/tailwind-webpack-encore-pack
npm install tailwindcss @tailwindcss/postcss postcss postcss-loader
npm run watch

If you use Flex that's it! This will create a postcss.config.mjs file and make sure your assets/styles/app.css contains the Tailwind directives.

If you don't use Symfony Flex, you need to create the postcss.config.mjs file manually in the root of your project with the following content:

// postcss.config.mjs
export default {
  plugins: {
    "@tailwindcss/postcss": {},
  },
};

Add the Tailwind directives to your assets/styles/app.css file:

/* assets/styles/app.css */
@import "tailwindcss";
@source not "../../public";

And enable PostCSS in your webpack.config.js file:

// webpack.config.js
Encore
  .enablePostCssLoader()
;

Done!

Usage

You need to run the npm run watch command:

npm run watch

That's it! This will watch for changes to your assets/styles/*.css and templates/* files and automatically recompile it when needed.

You can use Tailwind CSS classes in your Twig templates and CSS files.

Deploying

When you deploy, just run the npm run build:

npm run build

Requirement of fastfony/webapp-webpack-encore-pack

The repository fastfony/webapp-webpack-encore-pack is similar to the official symfony/webapp-pack but it requires Webpack Encore necessary packages instead of AssetMapper.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-10