承接 sulu/webpack-encore 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sulu/webpack-encore

Composer 安装命令:

composer require sulu/webpack-encore

包简介

A package to install webpack encore into your package without stimilus.

README 文档

README

Simple Webpack Encore implementation, with sass-loader for css. This package provides a simple recipe for webpack encore to use without Stimilus integration and webpack-encore-bundle.

Installation

composer require sulu/webpack-encore

The symfony/flex recipe should now generate the CSS/JS setup in your project directories.

Build CSS / JS

cd assets/website
npm install
npm run build

Embed JS / CSS

The JS:

<script src="{{ asset('build/website/main.js', 'website') }}"></script>

The CSS:

<link href="{{ asset('build/website/main.css', 'website') }}" rel="stylesheet">

After embedding you should see a colored background. This means your build did successfully work.

Remove Package

Now the best is you can savely remove this package. That symfony flex will not remove the recipe files we just checkout the composer files.

git checkout symfony.lock composer.lock composer.json

Preloading CSS / JS

If you want to preload the CSS or CSS you can do this using the symfony/web-link package:

composer require symfony/asset
composer require symfony/web-link

After this just wrap the asset function in preload e.g.:

The JS:

<script src="{{ preload(asset('build/website/main.js', 'website')) }}"></script>

The CSS:

<link href="{{ preload(asset('build/website/main.css', 'website')) }}" rel="stylesheet">

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固