Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build之后 html引入js 和压缩后js不一致 #6

Closed
jiyihui opened this issue Jul 16, 2019 · 4 comments
Closed

npm run build之后 html引入js 和压缩后js不一致 #6

jiyihui opened this issue Jul 16, 2019 · 4 comments

Comments

@jiyihui
Copy link

jiyihui commented Jul 16, 2019

image

image
如图 上图是打包之后的index.html 里面引入的js 第二张图是打包之后的js 列表,我本地node版本是 10.15.0 不知道是不是和node版本有关系

@jiyihui
Copy link
Author

jiyihui commented Jul 16, 2019

image
我又试了 8.9.4版本,还是对不上hash值

@jiyihui
Copy link
Author

jiyihui commented Jul 16, 2019

image

后来把webpack.base.conf.js 里面的 output的chuckhash改成 contenthash就解决了

@jiyihui
Copy link
Author

jiyihui commented Jul 16, 2019

我又试了下 不把 chunkhash改成contenthash也行,但是要加长度
output: {
publicPath: isProd ? './' : '',
path: path.resolve(__dirname, './dist'),
filename: 'js/' + (isProd ? '[name].[chunkhash:8].min.js' : '[name].js'),
chunkFilename: 'js/' + (isProd ? '[name].chunk.[chunkhash:10].min.js' : '[name].chunk.js'),
},

@xiaosan666
Copy link
Owner

是的确实有这问题,感谢,改为chunkhash:8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants