Release 3.0.0
[skip ci]
3.0.0 (2025-01-12)
⚠ BREAKING CHANGES
- drop Node.js < 18.19.0 support
part of https://github.com/eggjs/egg/issues/3644
https://github.com/eggjs/egg/issues/5257
Summary by CodeRabbit
New Features
- Updated package to
@eggjs/static- Enhanced TypeScript support
- Improved static file serving configuration
Chores
- Updated GitHub Actions workflows
- Modernized project configuration
- Updated Node.js version support to 18.19.0, 20, and 22
Documentation
- Updated README with new package details
- Simplified changelog and documentation
Refactor
- Migrated from CommonJS to ES modules
- Restructured project file organization
Features
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
@eggjs/static
Static server plugin for egg, base on @eggjs/koa-static-cache.
Install
@eggjs/staticis a plugin that has been built-in for egg. It is enabled by default.Configuration
@eggjs/staticsupport all configurations in @eggjs/koa-static-cache. And with default configurations below:'/public/'path.join(appInfo.baseDir, 'app/public')truefalse31536000in prod env,0in other envstruein prod env,falsein other envs@eggjs/staticprovides one more option:1000.All static files in
$baseDir/app/publiccan be visited with prefix/public, and all the files are lazy loaded.@eggjs/staticwill cache the assets after visited, you need to restart the process to update the assets.$baseDir/app/publicbut you can also define multiple directory by usedir: [dir1, dir2, ...]ordir: [dir1, { prefix: '/static2', dir: dir2 }], static server will use all these directories.Questions & Suggestions
Please open an issue here.
License
MIT
Contributors
Made with contributors-img.