Conversation
| @@ -0,0 +1,9 @@ | |||
| yarn lint-staged --allow-empty | |||
There was a problem hiding this comment.
Добавил линтеры ямл, ts-а и js-а + запустил их на прекоммите
| output: | ||
| clean: false | ||
| dir: build/site | ||
| dir: build/site/en |
There was a problem hiding this comment.
поднастроил тут, чтобы файлики по категории локали всё же были)
| import type { Compiler } from 'webpack' | ||
| import { spawnCommand } from '../helpers/spawnCommand' | ||
|
|
||
| export class BuildAntoraPlugin { |
There was a problem hiding this comment.
Добавил плагин, который билдит антору после компиляции сборки и после делает форсированное обновления в браузере
| // Compiler's webpack annotations are incompatible in types package:( | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore | ||
| import ZipPlugin from 'zip-webpack-plugin' |
There was a problem hiding this comment.
не получилось тут подтянуть типы, х его з почему)
| @@ -0,0 +1,87 @@ | |||
| // eslint-disable-next-line import/default | |||
There was a problem hiding this comment.
Разделил файлики на разную конфигурацию. common — общая конфигурация, dev - при разработке, prod - при продакшене
чтобы запустить разные сборки, нужно выполнить команды
npm start - dev
npm run build - prod
| import { getDirectoryFileNames } from './helpers' | ||
|
|
||
| const bundleName = 'ui-bundle' | ||
| const buildingScripts = getDirectoryFileNames(path.resolve(Env.cwd, './src/scripts')).reduce< |
There was a problem hiding this comment.
скрипты положил в отдельную папочку и компилирую их отдельным энтрипоинтом, чтобы потом подключить шаблон (смотри следующий коммент)
| fileName: 'partials/body-local-scripts.hbs', | ||
| filterKey: 'tagName', | ||
| filterValue: 'script', | ||
| filterByTagNode: filterInjectingScriptByScriptNames(['highlight.js', 'main.js']), |
There was a problem hiding this comment.
тут настроил темплейт body-local-scripts, который будет содержать в себе указанные в массиве скрипты. сам шаблон работает для каждой страницы
по сути, можно будет создавать partials указывая им нужные скрипты из папки script и инжектить их в любые layouts
| const config = merge<WebpackOptionsNormalized | Configuration>(commonConfig, { | ||
| mode: 'development', | ||
| target: 'web', | ||
| devServer: { |
There was a problem hiding this comment.
добавил дев сервер с хотрелодом
| @@ -0,0 +1,9 @@ | |||
| <footer> | |||
There was a problem hiding this comment.
добавил примерчик, чтобы протестить корректонсть работы скрипта:)
| @@ -0,0 +1,32 @@ | |||
| { | |||
There was a problem hiding this comment.
затащил ts, но не для обычных скриптов, в целом можно включить его и для них)
No description provided.