HAKASHUN / manabi

manabi
14 stars 1 forks source link

Gruntタスクの作り方整理する #42

Closed HAKASHUN closed 9 years ago

HAKASHUN commented 10 years ago

Gruntタスクを作りたい

今までもいくつか作ってきたが、かなり苦労してきたので、一度文献など整理しつつちゃんとしたフローで作ってみる。

HAKASHUN commented 10 years ago

日本語の文献

HAKASHUN commented 10 years ago

英語の文献

HAKASHUN commented 10 years ago

yeomanを入れる

npm install -g yo
npm install -g generator-gruntplugin

これでgruntタスクの雛形を入れるためのyeomanジェネレータが入った。

HAKASHUN commented 9 years ago

自作するプラグインの環境構築

grunt-remove-usestrict
├── Gruntfile.js
├── README.md
├── node_modules
├── package.json
├── tasks
└── test
HAKASHUN commented 9 years ago

npm publishして公開する

cd grunt-remove-usestrict
npm adduser

これでnpm publishする準備ができる。(npmのアカウントを取得する必要あり)

cd grunt-remove-usestrict
npm publish
HAKASHUN commented 9 years ago

一応つくったやつ

https://github.com/HAKASHUN/grunt-remove-usestrict

対象のスクリプトから"use strict"を削除します。

HAKASHUN commented 9 years ago

Travisバッジつけたい

上記を参考にtravisバッジをつけました。