PHPackages                             tanakahisateru/yii2-app-basic-npm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tanakahisateru/yii2-app-basic-npm

ActiveProject[Utility &amp; Helpers](/categories/utility)

tanakahisateru/yii2-app-basic-npm
=================================

How to use NPM with Yii 2 Basic Application Template

9803[2 issues](https://github.com/tanakahisateru/yii2-app-basic-npm/issues)PHP

Since Sep 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tanakahisateru/yii2-app-basic-npm)[ Packagist](https://packagist.org/packages/tanakahisateru/yii2-app-basic-npm)[ RSS](/packages/tanakahisateru-yii2-app-basic-npm/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

How to use NPM with Yii 2
=========================

[](#how-to-use-npm-with-yii-2)

This is an example how to use NPM with Yii 2.

```
composer create-project --stability=dev tanakahisateru/yii2-app-basic-npm
```

You can install Gulp or such as seamlessly via NPM now!

Modification points
-------------------

[](#modification-points)

### composer.json

[](#composerjson)

`provide` section added to skip them while Composer process. fxp-composer-asset-plugin is expected to be uninstalled.

```
{
    "provide": {
        "bower-asset/jquery": "*",
        "bower-asset/jquery.inputmask": "*",
        "bower-asset/bootstrap": "*",
        "bower-asset/punycode": "*",
        "bower-asset/typeahead.js": "*",
        "bower-asset/yii2-pjax": "*"
    },
    "scripts": {
        "post-install-cmd": [
            "yii\\composer\\Installer::postInstall",
            "npm install"
        ],
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject",
            "yii\\composer\\Installer::postInstall",
            "npm install"
        ]
    }
}
```

### package.json

[](#packagejson)

NPM alternatives.

```
{
  "dependencies": {
    "bootstrap": "^3.3.7",
    "jquery": "^2.2.4",
    "jquery.inputmask": "^3.3.4",
    "punycode": "^2.1.0",
    "typeahead.js": "^0.11.1",
    "yii2-pjax": "^2.0.6"
  },
  "devDependencies": {},
  "private": true
}
```

### config/web.php

[](#configwebphp)

```
