Sublime Text 3 和 sublime-grunt-build
Sublime Text 3 and sublime-grunt-build
所以我有一个错误,当我尝试构建时,命令行显示:
grunt-cli: The grunt command line interface. (v0.1.13)
[Finished in 0.1s with exit code 99]
[cmd: ['grunt.cmd', '--no-color']]
[dir: F:\LavkaLavka\Shop]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\PROGRA~1\SOFTWARE\System\DISKEE~1\;C:\Program Files (x86)\SOFTWARE\Players\Quick time\QTSystem\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\SOFTWARE\Design\NodeJS\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\SOFTWARE\Coders\MP4BOX;C:\Users3\AppData\Roaming\npm]
所以我用 npm 安装了 node.js,然后全局安装:
咕噜声
较少的
grunt-cli
无声无息
grunt-contrib-concat
grunt-contrib-less
然后在 sublime 中,我在这里解压了 ssublime-grunt-build 的最新 zip:
C:\Users3\AppData\Roaming\Sublime 文本 3\Packages\sublime-grunt-build
我在核心项目文件夹中有简单的 Sublime text 3 项目文件,只有这个基本文件夹:
{
"folders":
[
{
"path": "."
}
],
"settings":
{
"build_on_save": 1
}
}
与 package.json:
{
"name": "133",
"description": "This is only a test.",
"version": "1.0.0",
"keywords": [
"css",
"less",
"mobile-first",
"responsive",
"front-end",
"framework",
"web"
],
"author": "133",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-less": "~1.0.0",
},
"engines": {
"node": "~0.12"
}
}
和Gruntfile.js:
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * 133 v<%= pkg.version %>\n' +
' */\n',
// Task configuration.
concat: {
options: {
banner: '<%= banner %>',
stripBanners: false
},
dist: {
src: [
'js/133/transition.js',
'js/133/alert.js',
'js/133/button.js',
'js/133/carousel.js',
'js/133/collapse.js',
'js/133/dropdown.js',
'js/133/modal.js',
'js/133/tooltip.js',
'js/133/popover.js',
'js/133/scrollspy.js',
'js/133/tab.js',
'js/133/affix.js'
],
dest: 'js/133.js'
},
},
less: {
compileCore: {
options: {
strictMath: true
},
src: 'css/style.less',
dest: 'css/style.css'
}
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['concat', 'less']);
};
我已经使用 Bootstrap 3 个 js 文件进行测试
我错过了什么?
对于 grunt-cli 退出代码 99,我无法成功 google
我想没有官方信息...
请帮忙:)
好的,我似乎错过了通过 cd 在本地安装 grunt 到我的目录然后:安装 grunt ..有没有使用全局 grunt 和插件文件的方法,而不是安装到本地目录?在我的情况下它可能更方便)
所以我有一个错误,当我尝试构建时,命令行显示:
grunt-cli: The grunt command line interface. (v0.1.13)
[Finished in 0.1s with exit code 99]
[cmd: ['grunt.cmd', '--no-color']]
[dir: F:\LavkaLavka\Shop]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\PROGRA~1\SOFTWARE\System\DISKEE~1\;C:\Program Files (x86)\SOFTWARE\Players\Quick time\QTSystem\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\SOFTWARE\Design\NodeJS\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\SOFTWARE\Coders\MP4BOX;C:\Users3\AppData\Roaming\npm]
所以我用 npm 安装了 node.js,然后全局安装: 咕噜声 较少的 grunt-cli 无声无息 grunt-contrib-concat grunt-contrib-less
然后在 sublime 中,我在这里解压了 ssublime-grunt-build 的最新 zip: C:\Users3\AppData\Roaming\Sublime 文本 3\Packages\sublime-grunt-build
我在核心项目文件夹中有简单的 Sublime text 3 项目文件,只有这个基本文件夹:
{
"folders":
[
{
"path": "."
}
],
"settings":
{
"build_on_save": 1
}
}
与 package.json:
{
"name": "133",
"description": "This is only a test.",
"version": "1.0.0",
"keywords": [
"css",
"less",
"mobile-first",
"responsive",
"front-end",
"framework",
"web"
],
"author": "133",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-less": "~1.0.0",
},
"engines": {
"node": "~0.12"
}
}
和Gruntfile.js:
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
' * 133 v<%= pkg.version %>\n' +
' */\n',
// Task configuration.
concat: {
options: {
banner: '<%= banner %>',
stripBanners: false
},
dist: {
src: [
'js/133/transition.js',
'js/133/alert.js',
'js/133/button.js',
'js/133/carousel.js',
'js/133/collapse.js',
'js/133/dropdown.js',
'js/133/modal.js',
'js/133/tooltip.js',
'js/133/popover.js',
'js/133/scrollspy.js',
'js/133/tab.js',
'js/133/affix.js'
],
dest: 'js/133.js'
},
},
less: {
compileCore: {
options: {
strictMath: true
},
src: 'css/style.less',
dest: 'css/style.css'
}
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', ['concat', 'less']);
};
我已经使用 Bootstrap 3 个 js 文件进行测试 我错过了什么?
对于 grunt-cli 退出代码 99,我无法成功 google 我想没有官方信息...
请帮忙:)
好的,我似乎错过了通过 cd 在本地安装 grunt 到我的目录然后:安装 grunt ..有没有使用全局 grunt 和插件文件的方法,而不是安装到本地目录?在我的情况下它可能更方便)