slime pack 생성 함수 상세 설명 및 밤 사용
3208 단어 프런트엔드 자동화javascript
slime.js, css의 생산과 개발 환경에 필요한 파일을 생성합니다. 생산 환경은 자동으로 압축과hash를 가져옵니다.gulp에 익숙하지 않은 학생에게는 좋은 학습 자료일 수 있습니다. 안에 있는 원본과 구조를 보면 회사에서 프로젝트를 시작할 수 있습니다.
다음은 슬림.build 함수에 대한 상세한 설명
//style: ['css', 'scss', 'sass', 'less', 'stylus', 'styl']
//templet: ['hbs', 'swig', 'htm', 'html', 'php', 'jsp']
//script: ['js', 'jsx', 'coffee', 'cjsx']
/*
*
* {parm1} {string} // , , d:\xxx\yyy.js
* {string} // ,config , config -> pages
* {string} // , d:\xxx
* {array} // , string ['d:\xxx\yyy.js','d:\xxx\aaa.js']
* {json} // JSON*
* {parm2} {boolean}// / ,true= 、false=
* {parm3} {json object}
* return stream
*/
var slime = require('./_builder/configs/slime.config.js');
slime.build(entry, [pack], [options])
// 、 `{key: value}` ,vlaue , json
options:
* [rename] :String ---
// key
0、slime.build('./a', true, {rename: 'xxx',type: 'sass'}) // xxx.css
1、slime.build(['a.js','b.js'],{rename: 'xxx'}) // xxx.js
2、slime.build({aaa: ['a.jsx','b.js']},{rename: 'xxx'}) // xxx.js
3、slime.build('./abc.js',{rename: 'xxx'}) // xxx.js
* [type] :String --- script ,style/templet, ,
//
1、slime.build('./a',{type: 'sass'})
2、slime.build('./a',{type: 'hbs'})
* [prepend] :Array ---
//value
1、slime.build('./a',{prepend: ['./xxx.js']})
* [apend] :Array ---
//value
1、slime.build('./a',{apend: ['./xxx.js']})
# css (coffee)
config = require '../configs/config.coffee'
test = config.dirs.src + '/css/pages/website/index.scss' #string // index.css
ary = [ #array // css
config.dirs.src + '/css/pages/website/index.scss',
config.dirs.src + '/css/pages/website/error-404.scss',
config.dirs.src + '/css/pages/website/error-500.scss'
]
testcommon1 = {ggggg: ary} #json // ggggg.css
testcommon2 = {ggggg: ary,kkkkk: test} #json // ggggg.css、kkkkk.css
module.exports = (gulp,$,slime)->
return () ->
slime.build(test,false,{type: 'sass'});
# slime.build(testcommon1,false,{type: 'sass'});
# slime.build(testcommon2,{type: 'sass'});
# js (coffee)
config = require '../configs/config.coffee'
test = config.dirs.src + '/js/pages/h5/lazypage/lazypage.jsx'
ary = [
config.dirs.src + '/js/pages/h5/loadpage/loadpage.jsx'
]
testcommon1 = {ggggg: ary}
testcommon2 = {ggggg: ary,kkkkk: test}
module.exports = (gulp,$,slime)->
return (cb) ->
slime.build(testcommon2,cb);
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
v-bind를 사용하여 CSS에 대한 Vue3 상태애플리케이션을 더 동적으로 만들기 위해 Vue는 동적 상태를 템플릿 내부의 마크업에 연결할 수 있도록 합니다. 예를 들어 특정 기준이 충족되는 경우에만 요소에 클래스를 적용할 수 있습니다. 그러나 구성 요소 상태가 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.