W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
(string | { from: string, to: string })[]
?[]
?設(shè)置要復(fù)制到輸出目錄的文件或文件夾,該配置受 ?ignore
? 配置 影響
默認(rèn)情況下,MorJS 會(huì)自動(dòng)拷貝如下后綴的文件:
# 以下資源文件會(huì)在編譯過(guò)程中自動(dòng)拷貝
.jpg
.jpeg
.png
.svg
.bmp
.ico
.gif
.webp
.otf
.ttf
.woff
.woff2
.eot
.cer
.ogg
.aac
.mp4
.wav
.mp3
.m4a
.silk
.wasm
.br
.cert
當(dāng)配置為字符串時(shí),默認(rèn)拷貝到產(chǎn)物目錄,如:
{
copy: ['foo.json', 'src/bar.json']
}
會(huì)產(chǎn)生如下產(chǎn)物的目錄結(jié)構(gòu):
+ dist
- bar.json
- foo.json
+ src
- bar.json
- foo.json
當(dāng)通過(guò)對(duì)象配置具體的拷貝位置,其中 ?from
? 相對(duì)路徑的起點(diǎn)為項(xiàng)目根目錄,目標(biāo) ?to
? 相對(duì)路徑的起點(diǎn)為 ?outputPath
? 配置所指向的目錄:
{
copy: [
{ from: 'from', to: 'somewhere/insideOutputPath' },
{ from: 'anotherFile.json', to: './' }
]
}
這種情況下將產(chǎn)生如下產(chǎn)物目錄結(jié)構(gòu):
+ dist
+ somewhere
+ insideOutputPath
- onefile.json
- anotherFile.json
+ from
- onefile.json
- anotherFile.json
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話(huà):173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: