vue-cli icon indicating copy to clipboard operation
vue-cli copied to clipboard

npm run build is placing images under dist root

Open ghost opened this issue 8 years ago • 10 comments

Version

3.0.0

Node and OS info

node v8.11.1 yarn 1.7.0 window 10

Steps to reproduce

npm run build 超过4KB大小图片生成的位置在dist根目录下。

What is expected?

期望:生成的图片放在img 文件夹下。

What is actually happening?

生成的图片在dist根目录下。

ghost avatar Aug 16 '18 02:08 ghost

遇到了同样的问题,此问题只存在windows系统下,Mac下无此问题

thomasyus avatar Aug 16 '18 05:08 thomasyus

@thomasyus ……

ghost avatar Aug 16 '18 05:08 ghost

The same bug happening in my MacOS.

panjiang avatar Aug 16 '18 07:08 panjiang

The same bug happening in windows

julytian avatar Aug 16 '18 12:08 julytian

同样问题,win10

libin1991 avatar Aug 16 '18 13:08 libin1991

This is a regression in url-loader 1.1.0...

yyx990803 avatar Aug 16 '18 13:08 yyx990803

This has been fixed in https://github.com/webpack-contrib/url-loader/commit/401be635da13ed19be389af2b28764302a3e5cdc. Waiting for their release...

yyx990803 avatar Aug 16 '18 13:08 yyx990803

any prediction for the release of the next version containing this fix? is there a way that I can make this fix with vue.config.js?

kevinfaveri avatar Aug 16 '18 14:08 kevinfaveri

If you use yarn you can explicit pin url-loader to 1.0.1 using resolutions field in your package.json.

yyx990803 avatar Aug 16 '18 14:08 yyx990803

我也遇到了这个问题,现在 build 命令形成的目录结构是 ok 的,build --watch 命令形成的目录结构是错误的,而且还不会生成 source-map(系统是 win10)。

错误的(build --watch): image

正确的(build): image

最后再弱弱的问一句,默认的图片输出目录是 img/,假如说我想给他改成 image/,该修改哪个参数呢

RequireSun avatar Oct 02 '18 12:10 RequireSun