Skip to content

v1.29.0

Choose a tag to compare

@vovkabelov vovkabelov released this 12 Oct 14:37
· 67 commits to main since this release

В bundle.config появился параметр banner — комментарий, который добавляется в JS-бандл при каждой сборке, например копирайт или лицензия. Строка добавляется в начало бандла, а объект { top, bottom } позволяет добавить текст в начало, в конец или в оба места. Обычный текст оборачивается в юридический комментарий /*! ... */, который сохраняют минификаторы и сборщики при повторной обработке бандла; текст, уже оформленный как комментарий, вставляется как есть. Баннер добавляется в готовый бандл, поэтому его не удаляют ни очистка комментариев в TypeScript-сборке, ни минификация, а при concat он оборачивает весь склеенный файл. Source map сдвигается на добавленные строки, и позиции в отладчике остаются верными.


bundle.config has a new banner option — a comment added to the JS bundle on every build, such as a copyright notice or a license. A string is added to the top of the bundle, and an object { top, bottom } adds text to the top, the end or both. Plain text is wrapped into a legal comment /*! ... */, which minifiers and bundlers keep when the bundle is processed again; text that is already a comment is inserted as is. The banner is added to the finished bundle, so neither comment stripping in TypeScript builds nor minification removes it, and with concat it wraps the whole concatenated file. The source map is shifted by the added lines, so positions in the debugger stay correct.