在我的 vue-cli3 项目中,当我运行构建命令时,我会得到通常的 index.html + 3 个文件夹(css、js、img)。
是否可以以某种方式将 img 文件夹的名称更改为“images”?
我想我必须在 vue.config.js 中添加一些内容来指示 webpack,但我找不到任何相关信息。
感谢您的指点。
根据 @Emin Me\xc5\xa1i\xc4\x87 我能够通过将其添加到我的 vue.config.js 来实现这一点
\n\nchainWebpack: config => {\n config.module.rule('images').use('url-loader')\n .loader('file-loader') // replaces the url-loader\n .tap(options => Object.assign(options, {\n name: 'images/[name].[hash:8].[ext]'\n }))\n config.module.rule('svg').use('file-loader')\n .tap(options => Object.assign(options, {\n name: 'images/[name].[hash:8].[ext]'\n }))\n },\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
1305 次 |
| 最近记录: |