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

小程序静态资源走CDN #3152

Closed
wants to merge 4 commits into from
Closed

小程序静态资源走CDN #3152

wants to merge 4 commits into from

Conversation

xshua06
Copy link
Contributor

@xshua06 xshua06 commented May 23, 2019

小程序用到的静态资源走CDN

当配置有中时

{
  weapp: {
    publicPath: `${publicPath}/${config.projectname}`,
    staticDirectory: 'assets/static'
  }
}

生产换打包后静态资源可走CDN

开发环境下,静态资源依然是打包到dist/weapp下
生产环境下,静态资源打包到dist/assets,可将该目录下文件上CDN

subject: 支持小程序静态资源走cdn,不打进小程序包,以减小大小
 支持小程序静态资源走cdn,不打进小程序包,以减小大小
@@ -0,0 +1,62 @@
import crypto from 'crypto';
const fs = require('fs');
const xxh = require('xxhashjs');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xxhashjs 的作者似乎已经很久不维护了,你可以以其他正在积极维护的包代替它吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以

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

Successfully merging this pull request may close these issues.

2 participants