jeff2ma / jgulp Goto Github PK
View Code? Open in Web Editor NEW利用Gulp 配置的个人前端项目自动化工作流
利用Gulp 配置的个人前端项目自动化工作流
gulpfile.js
文件中的config = require('./config.json');
引用的config.json找不到在哪里。
tiny-lr
、gulp-webserve
和gulp-livereload
三个包的用法不是不懂。=.=
控制台提示: Individual stylesheets must be in the sass directory.
这段代码怎么去掉呀?
我该用什么来配合这个cli呢
如题所示
1,安装node.js最新版;
2,下载JGulp最新版ZIP解压;
3,创建config.json并修改key;
4,gulp build 运行出错:
You need to have Ruby and Compass installed and in your system PATH for this task to work.
下载
http://rubyinstaller.org/downloads/,
安装(要翻墙)
gem install compass
5,gulp build 运行出错:
D:\xampp1\htdocs\JGulp-master>gulp build
[15:20:40] Using gulpfile D:\xampp1\htdocs\JGulp-master\gulpfile.js
[15:20:40] Starting 'build'...
gulp.run() has been deprecated. Use task dependencies or gulp.watch task trigger
ing instead.
[15:20:40] Starting 'imagemin'...
[15:20:40] Starting 'compass'...
[15:20:40] Finished 'compass' after 4.99 ms
[15:20:40] Starting 'minifyjs'...
[15:20:40] Finished 'minifyjs' after 2.47 ms
[15:20:40] Starting 'alljs'...
[15:20:40] Starting 'buildfiles'...
[15:20:40] Finished 'buildfiles' after 3.12 ms
[15:20:40] Starting 'rename'...
[15:20:40] Finished 'build' after 31 ms
[15:20:40] Finished 'alljs' after 19 ms
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn D:\xampp1\htdocs\JGulp-master\node_modules\gulp-imagemin\node_modul
es\imagemin\node_modules\imagemin-optipng\node_modules\optipng-bin\vendor\optipn
g.exe ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
环境:
D:\xampp1\htdocs\JGulp-master>ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]
D:\xampp1\htdocs\JGulp-master>npm -v
2.7.4
D:\xampp1\htdocs\JGulp-master>compass -v
Compass 1.0.3 (Polaris)
Copyright (c) 2008-2015 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compas
s
D:\xampp1\htdocs\JGulp-master>node -v
v0.12.2
D:\xampp1\htdocs\JGulp-master>gulp build2
[15:33:13] Using gulpfile D:\xampp1\htdocs\JGulp-master\gulpfile.js
[15:33:13] Starting 'build2'...
gulp.run() has been deprecated. Use task dependencies or gulp.watch task trigger
ing instead.
[15:33:13] Starting 'tinypng'...
[15:33:13] Finished 'tinypng' after 8.55 ms
[15:33:13] Starting 'compass'...
[15:33:13] Finished 'compass' after 4.23 ms
[15:33:13] Starting 'minifyjs'...
[15:33:13] Finished 'minifyjs' after 2.04 ms
[15:33:13] Starting 'alljs'...
[15:33:13] Starting 'buildfiles'...
[15:33:13] Finished 'buildfiles' after 2.98 ms
[15:33:13] Starting 'rename'...
[15:33:13] Finished 'build2' after 28 ms
[15:33:13] Finished 'alljs' after 16 ms
[15:33:14] Finished 'rename' after 46 ms
[15:33:14] LoadError on line ["54"] of C: cannot load such file -- compass-norma
lize
Run with --trace to see the full backtrace
[15:33:14] Plumber found unhandled error:
Error in plugin 'gulp-compass'
Message:
Compass failed
Details:
fileName: D:\xampp1\htdocs\JGulp-master\sass\style.scss
[15:33:21] gulp-tingpng: [compressing] ✔ info.png (done)
不是应该先建立发布目录(build),然后再run各种压缩合并处理吗?
我看过你的配置,我很喜欢,如果如果可以加入postcss和jade,在我看来更完美了。
Cannot find module 'vinyl'
你好,看了下你的gulpfile.js
,你是把所有的js的进行打包和压缩,那有没有一种方式,对js,css,img等按照页面分别进行打包,比如js的文件里有index
, detail
, login
等文件夹,每个文件夹都着自己页面的js,分别对index, detail和login里的js进行打包,然后生成:index.min.js, detail.min.js和login.min.js呢
最近我一直在想这个问题,不知道用什么方法进行解决,目前考虑的仅仅是文件夹打包,没有使用seajs
或requirejs
等
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.