Comments (1)
Fixed at [email protected]
原因
有个恶心的 Nginx 正则,会导致纯数字的 hash 访问时404
location ~ /dev/ {
rewrite ^(.*?)-(\d+[\d.])\.(js|css)$ $1-dev.$3 last;
}
解决方案
- 增加longTermCachingSymbol参数,让编译产物名称具有更多灵活性
具体用法
在项目的 config/packing.js
中可以配置longTermCachingSymbol
export default (packing) => {
const p = packing;
// 默认为下划线 `_`,输出为 `xx_xxxxxx.js`
p.longTermCachingSymbol = '-';
return p;
};
兼容性
由于修改了默认的连接符,从[email protected]起,编译输出产物和之前的版本存在差异,表现为:
- <2.6.5:文件名为 xx
-
xxxxxxxx.js - >=2.6.5:文件名为 xx
_
xxxxxxxx.js
如果需要保持和2.6.5以前的版本输出一直,请在 config/packing.js
中增加如上的 longTermCachingSymbol
配置
from packing.
Related Issues (20)
- 修复开发环境下CSS文件返回404的问题 HOT 3
- packing 打包错误之后没有退出,没有被阻断jenkins编译! HOT 1
- 页面代码变更也会影响到vendor.js版本号 HOT 3
- warning ... : we recommend using babel-preset-env now: HOT 2
- 本地服务时,css文件以及manifest文件报404错误 HOT 1
- 引用静态资源build之后相对路径替换成`_/..`;开发环境中commonChunk内引用资源文件未正确打包。 HOT 1
- packing的api转发未带上cookie HOT 1
- Can't resolve 'fs' HOT 1
- async/await语法报错 HOT 1
- 在entry注入polyfill后运行报错 HOT 1
- packing对多个webpack配置的支持问题
- 提供webpackDevMiddleware配置项writeToDisk
- mock返回数据为Object类型时问题 HOT 2
- /bin/sh: node_modules/.bin/babel-node: No such file or directory HOT 2
- 使用包含hooks API的react版本时,生产环境版本压缩代码后报错 TypeError: Cannot set property 'lastEffect' of null HOT 1
- 升级 [email protected] HOT 1
- postcss.config.js 配置 cssnano HOT 3
- less 使用打包报错
- generator-packing 生成工程 postcss 默认使用 .postcssrc.js 配置 stylelint 出现警告 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packing.