小编use*_*895的帖子

grunt watch livereload致命错误:端口35279已被另一个进程使用

我正在尝试使用livereload和watch.我一直收到消息"致命错误:端口35279已被另一个进程使用".我已经更改了livereload的端口,但没有重新加载.

module.exports = function(grunt) {
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    compass: {
      dist: {
        options: {
          cssDir: 'stylesheets',
          sassDir: 'stylesheets/sass/',
          imagesDir: 'images',
          javascriptsDir: 'scripts',
          require: ['sass-globbing','modular-scale'],
          force: true
        }
      }
    },
    cssmin: {
      minify: {
        expand: true,
        cwd: 'stylesheets',
        src: ['*.css', '!*.min.css'],
        dest: 'stylesheets',
        ext: '.min.css'
      }
    },
    watch: {
        options: {
            livereload: true
        },
        sass: {
            files: 'stylesheets/sass/*.scss',
            tasks: ['compass']
        },
        css: {
            files: 'stylesheets/*.css',
            tasks: ['cssmin']
        },
        html: {
            files: ['index.html','**/*.css']
        }
    }
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default',['compass','watch']);
Run Code Online (Sandbox Code Playgroud)

}

gruntjs livereload grunt-contrib-watch

9
推荐指数
3
解决办法
7225
查看次数

捆绑订单如何在browserify中运行?

我无法弄清楚browserify如何捆绑其所需文件的逻辑.如果我这样做

require('./one/one.js');
require('./two/two.js');
require('./three/three.js');
Run Code Online (Sandbox Code Playgroud)

输出就是这个

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var app = "app";

console.log(one);
},{}],2:[function(require,module,exports){
require('./one/one.js');
require('./two/two.js');
require('./three/three.js');
//require('./three/three_a/three_a.js');
require('./app.js');
},{"./app.js":1,"./one/one.js":3,"./three/three.js":4,"./two/two.js":5}],3:[function(require,module,exports){
var one = "one";
},{}],4:[function(require,module,exports){
var three = "three";
},{}],5:[function(require,module,exports){
var two = "two";
},{}]},{},[2])
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,"三个"是在"两个"之前捆绑的,但那不是我要求它们的顺序吗?

javascript browserify

5
推荐指数
1
解决办法
2836
查看次数

如何将现有应用程序停靠...基础知识

我观看了大量的YouTube视频,并阅读了所有的docker文档.但是我仍然没有得到阻止我理解docker的核心概念.我正在使用Windows并安装了boot2docker.我从docker hub下载了图像并运行了基本命令.但是如何将现有应用程序放在我的本地计算机上(为简单起见,我们只能说它有一个文件'index.php').我该如何处理并将其放入泊坞窗图像并运行它?

docker boot2docker

5
推荐指数
2
解决办法
1万
查看次数

当更改另一个文件如css或JS时,如何使用Grunt live-reload重新加载html

所以我爱上了咕噜咕噜的生活重装.我不明白的一件事是当css或js重新加载时如何让我的html重新加载.使用下面的代码,使用live-reload chrome扩展程序实时监视和更新HTML.但是当sass被编译成css时,我需要html来重新加载.

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        compass: {
          dist: {
            options: {
              cssDir: 'styles',
              sassDir: 'sass',
              imagesDir: 'images',
              javascriptsDir: 'scripts',
              force: true
            }
          }
        },
        cssmin: {
          minify: {
            expand: true,
            cwd: 'styles',
            src: ['*.css', '!*.min.css'],
            dest: 'styles',
            ext: '.min.css'
          }
        },
        watch: {
            sass: {
                files: '**/*.scss',
                tasks: ['compass']
            },
            css: {
                files: '**/*.css',
                tasks: ['cssmin'],
            },
            html: {
                files: ['index.html','**/*.css'],
                options: {
                    livereload: true
                }
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib');
    grunt.registerTask('default',['watch','compass']);
}
Run Code Online (Sandbox Code Playgroud)

html gruntjs

3
推荐指数
1
解决办法
7831
查看次数