README
nd-file-loader for webpack
使用
usePath:是否使用路径编码
例子
{
test: /\.(png|jpg|gif|svg|woff2?|eot|ttf)(\?.*)?$/,
loader: `file?name=images/[name]_[hash:7].[ext]&usePath=true`
},
hash 是基于文件路径而不是文件内容
安装
npm install nd-file-loader --save-dev
增强 file-loader 功能,对文件路径进行编码
<script type="module">
import ndFileLoader from 'https://cdn.skypack.dev/nd-file-loader';
</script>
usePath:是否使用路径编码
{
test: /\.(png|jpg|gif|svg|woff2?|eot|ttf)(\?.*)?$/,
loader: `file?name=images/[name]_[hash:7].[ext]&usePath=true`
},
hash 是基于文件路径而不是文件内容
npm install nd-file-loader --save-dev