grunt 命令在配置 EaselJS 项目时不运行服务器
grunt command does not run server while configuring EaselJS project
我在 EaselJS 中配置我的项目以进行游戏开发时遇到了一些问题。下面你可以看到我的Grunt.js
文件。
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
build: {
files: {
'build/scripts/app.bundle.js': ['app/lib/main.js']
}
}
},
copy: {
scripts: {
src: [
'bower_components/easeljs/lib/easeljs-0.8.0.combined.js',
],
dest: 'build/scripts/',
expand: true,
flatten: true
},
html: {
src: [
'app/index.html',
],
dest: 'build/',
expand: true,
flatten: true
}
},
connect: {
server: {
options: {
port: 9001,
base: 'build'
}
}
},
watch: {
options: {
livereload: true
},
scripts: {
files: ['app/lib/**/*.js', 'app/*.html'],
tasks: ['build']
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-browserify');
// Default task(s).
grunt.registerTask('build', ['browserify', 'copy']);
grunt.registerTask('default', ['build', 'connect', 'watch']);};
每当我在命令行上运行 grunt 命令时,Windows 都会询问"如何打开此文件?当我选择浏览器时,它只是打开并向我显示 Grunt.js 文件。
如果您能帮助我解决这个问题,我将不胜感激。谢谢
好吧,
我想通了。我将我的文件命名为Grunt.js
而不是Gruntfile.js
。我将其更改为Gruntfile.js
,运行了grunt命令,它按预期工作。
相关文章:
- Meteor如何运行服务器端python脚本
- "无法获取/null”;当使用nodejs运行服务器时
- 在客户端 Javascript 方法之后运行服务器方法
- grunt 命令在配置 EaselJS 项目时不运行服务器
- 在与运行服务器脚本的驱动器不同的驱动器中打开文件
- C#/ASP-web,ASP:在客户端执行复选框消息框,如果是,则运行服务器端代码
- 在使用nodejs运行服务器端时,无法加载角度控制器文件
- 为什么在 React 中.js文档(“教程”部分)描述了运行服务器的必要性
- 从嵌套的 jquery 对话框运行服务器端方法
- 运行服务器端 Javascript
- 在JS中运行服务器端python:pico的困难
- 是否可以在node.js服务器上设置一个运行(服务器端)的socket.io客户端
- NodeJS:一直在运行服务器
- 当我在django中运行服务器时,我收到了这个请求错误,i'我一直在使用引导程序
- 如何使用HtmlService运行服务器端函数
- 在使用javascript向下拉列表添加项目并运行服务器端代码后,无效的回发或回调参数
- 如何运行服务器端JS
- 有没有办法从浏览器运行服务器或点对点?
- 如何在客户端浏览器中运行服务器端javascript
- 当我需要运行服务器端代码时,我如何响应按钮的单击(不提交页面)?