Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript gruntfile中的引导使用_Javascript_Node.js_Twitter Bootstrap_Gruntjs_Gruntfile - Fatal编程技术网

Javascript gruntfile中的引导使用

Javascript gruntfile中的引导使用,javascript,node.js,twitter-bootstrap,gruntjs,gruntfile,Javascript,Node.js,Twitter Bootstrap,Gruntjs,Gruntfile,我目前正在使用node/npm和grunt开发一个web应用程序。我是web开发新手,来自java开发。这就是我的原型结构的样子: prototype |--app |--index.html |--index.js |--dist |--index.html |--index.js |--lib (currently empty) |--Gruntfile.js |--package.json 我计划使用以下结构进行开发:我的代码将通过使用lib文件夹中的npm模块进

我目前正在使用node/npm和grunt开发一个web应用程序。我是web开发新手,来自java开发。这就是我的原型结构的样子:

prototype
|--app
   |--index.html
   |--index.js
|--dist
   |--index.html
   |--index.js
|--lib (currently empty)
|--Gruntfile.js
|--package.json
我计划使用以下结构进行开发:我的代码将通过使用lib文件夹中的npm模块进行模块化。这些将包含在index.js中。应用文件夹中的index.html和index.js文件将使用grunt browserify和grunt contrib copy为浏览器构建;结果将被放入dist文件夹。我还计划使用引导

在bootstrap启动指南中,有一段文字写道,grunt dist将重新生成包含bootstrap的dist文件夹

我的第一个问题是:这是怎么发生的?我想你必须把引导文件夹放在某个地方。或者我需要安装一些与引导相关的软件包吗?简而言之:grunt是如何知道引导的

我的第二个问题是:如何在Grunfile中包含此过程?现在,我的GrunFile使用browserify来浏览index.js,并使用copy来复制index.html。这些都是在目标上注册的,这是正确的术语吗?默认值:grunt.registerTask'default',['browserify','copy',];。我想通过添加grunt dist中发生的引导魔术来改变这个目标


非常感谢您的帮助

您所指的目标位于引导构建环境中。您可以通过npm安装下载此文件bootstrap@3他们引用的grunt dist目标也包含在下载的节点\u modules\bootstrap\Gruntfile.js中,用于编译引导程序本身以进行分发

 grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']);
dist目标使用了几个grunt模块,如grunt contrib htmlmin和grunt contrib cssmin,但在您的设置中可能并不需要所有模块。 我建议看一下这个文件,以及每个被调用的目标和用于指导如何继续的模块

如果您只想在项目中使用引导,您可以下载已经编译和缩小的库,然后将它们添加到您的项目中