Go to package directory cd vendor/snowdog/frontools
Run yarn or npm install
Decide where you want to keep your config files.
You can store them in Frontools config directory or in dev/tools/frontools/config (recommended).
There is a setup task to copy all sample config files from the config to dev/tools/frontools/config and create a convenient symlink tools in the project root.
If you want to keep config files inside frontools config dir, you have to handle this manually.
Define your themes in themes.json.
themes.json structure
Check config/themes.json.sample to get samples.
src - full path to theme
dest - full path to pub/static/[theme_area]/[theme_vendor]/[theme_name]
locale - array of available locales
parent - name of parent theme
stylesDir - (default styles) path to styles directory. For theme-blank-sass it's styles. By default Magento 2 use web/css.
disableSuffix - disable adding .min suffix using --prod flag.
postcss - (default ["autoprefixer({ overrideBrowserslist: browserslist })"]) PostCSS plugins config. Have to be an array.
modules - list of modules witch you want to map inside your theme
ignore - array of ignore patterns
watcher.json structure
Check config/watcher.json.sample to get samples.
usePolling - set this to true to successfully watch files over a network (i.e. Docker or Vagrant) or when your watcher dosen't work well. Warning, enabling this option may lead to high CPU utilization! chokidar docs
sass-compiler.json structure
You can choose Sass compiler between the default, but already deprecated, node-sass or a newer and faster dart-sass.
Since the Dart Sass does not have the same set of features as Node Sass, for now we will keep the older version as default.
Optional configurations for 3rd party plugins
You will find sample config files for theses plugins in vendor/snowdog/frontools/config directory.
--ci - Enable throwing errors. Useful in CI/CD pipelines.
inheritance - Create necessary symlinks to resolve theme styles inheritance and make the base for styles processing. You have to run in before styles compilation and after adding new files.
请发表评论