dawen/config-to-js-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dawen/config-to-js-bundle

Composer 安装命令:

composer require dawen/config-to-js-bundle

包简介

Provides a command to dump defined config to js file

README 文档

README

Build Status

Provides a command to dump defined config to js file.

Installation

Step 1: Composer

Required in composer.json

   "dawen/config-to-js-bundle": "~1.0"

Run composer update dawen/config-to-js-bundle after modifiering composer.json file.

Step 2: AppKernel

In your app/config/AppKernel.php file you should activate the bundle by adding it to the array

    $bundles[] = new Dawen\Bundle\ConfigToJsBundle\ConfigToJsBundle();

Step 3: Configuration

    config_to_js:
      type: 'module'
      output_path: '%kernel.root_dir%/../web/js/app-config.js'
      config:
        imageLocation: 'http://this-is-an-example.com/images'
        appVersion: '1.1.0'

If parameter are not defined, default values will be applied.

Step 4: Run the command

Go to your console and run

    bin/console config:js:dump

Configuration Parameter Description

type:

possible values: module default value: module description: This defines for what the dumped code is optimized.

output_path:

possible values: a valid string for a filepath default value: null description: This parameter defines a path and filename that will be created. If this value is not set, the dumper will throw an error.

config:

possible values: array default value: empty array description: Here you can create you config vars that should be availabe on your javascript side.

Supported Types/Renderers

module: Your file is includeable by module pattern like this: import appConfig from './ccurrent-folder/web/js/app-config.js'

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固