定制 programster/js-demo-welcomer 二次开发

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

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

programster/js-demo-welcomer

Composer 安装命令:

composer require programster/js-demo-welcomer

包简介

Example javascript package

README 文档

README

This is a demonstration package of how one can use composer for building and distributing Javascript packages. The implementation demo is here.

Installation / Usage

In order to use this packages, one will need to use composer require/install the package as usual:

composer require programster/js-demo-welcomer

However, yout then probably want to add the following scripts section to your composer.json file in order to have the package automatically install the source code to the public_html/js folder. Obviously if you want the sourceelsewhere, you would just update the paths accordingly.

One has to manually add the scripts section themselves because the scripts of the packages themselves are not automatically executed (probably for security). Only the scripts in the root composer.json file are executed.

{
    "require": {
        "programster/js-demo-welcomer": "0.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "rm -f public_html/js/js-demo-welcomer && ln -s ../../vendor/programster/js-demo-welcomer/src public_html/js/js-demo-welcomer"
        ],
        "post-update-cmd": [
            "rm -f public_html/js/js-demo-welcomer && ln -s ../../vendor/programster/js-demo-welcomer/src public_html/js/js-demo-welcomer"
        ]
    }
}

For this package, a full example composer.json file would be as follows:

{
    "require": {
        "programster/js-demo-welcomer": "0.1.*"
    },
    "scripts": {
        "post-install-cmd": [
            "rm -f public_html/js/js-demo-welcomer && ln -s ../../vendor/programster/js-demo-welcomer/src public_html/js/js-demo-welcomer"
        ],
        "post-update-cmd": [
            "rm -f public_html/js/js-demo-welcomer && ln -s ../../vendor/programster/js-demo-welcomer/src public_html/js/js-demo-welcomer"
        ]
    }
}

Then you would use this package like so in your source code:

...
<body>
<script src="js/js-demo-welcomer/Welcomer.js"></script>
<script type="text/javascript">
    var welcomer = new Welcomer("James");
    welcomer.run();
</script>
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固