通常の Grunt を実行するために Vagrant ボックス (precise32) をセットアップしましたが、時間がかかりすぎます。
Running "watch" task
Waiting...OK
>> File "../../home/vagrant/app/wp-content/themes/testcss/_vars.scss" changed.
Running "sass:dist" (sass) task
File "/home/vagrant/app/wp-content/themes/test/css/styles.css" created.
Done, without errors.
Completed in 40.392s at Mon Dec 02 2013 11:34:02 GMT+0000 (UTC) - Waiting...
OK
>> File "../../home/vagrant/app/wp-content/themes/test/css/styles.css" changed.
Completed in 0.000s at Mon Dec 02 2013 11:34:02 GMT+0000 (UTC) - Waiting...
VM内の共有フォルダーとネイティブフォルダーでこれを試しましたが、変更はありません。私は grunt-contrib-sass プラグインを使用していますが、grunt-sass も試しましたが、同様の時間がかかります。監視イベントはすぐに発生しますが、CSS のコンパイルが完了するまで、VM はすべての予備の CPU 使用率を消費します。
sass を手動で実行すると、約 2 秒かかります
ここからどこへ行けばいいですか?
パッケージ.json
{
"name": "www",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-autoprefixer": "~0.4.0",
"grunt-concurrent": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.3.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-google-cdn": "~0.2.0",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.2.0",
"grunt-usemin": "~2.0.0",
"jshint-stylish": "~0.1.3",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.1",
"karma-ng-scenario": "~0.1.0",
"grunt-karma": "~0.6.2",
"karma-chrome-launcher": "~0.1.0",
"karma-script-launcher": "~0.1.0",
"karma-firefox-launcher": "~0.1.0",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.3",
"requirejs": "~2.1.9",
"karma-requirejs": "~0.2.0",
"karma-coffee-preprocessor": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.0",
"karma": "~0.10.5",
"karma-ng-html2js-preprocessor": "~0.1.0",
"grunt-contrib-sass": "~0.5.1",
"grunt-php": "~0.3.0"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}
編集:
問題がどこにあるのかおおまかにわかりました。私の grint-contrib-sass タスクが grunt-contrib-watch からトリガーされると、実際には Grunt のすべてのモジュールがリロードされます。なぜこれを行っているのか、なぜこれが必要なのかわかりません。これを反映するために質問のタイトルを変更しました。