District Core Developer DocsDistrict Core Developer Docs
Developers
Boilerplate
Modules
Bitbucket
Developers
Boilerplate
Modules
Bitbucket
  • Developers

    • Getting-Started
    • Git
    • Changelog
    • Building
    • Tests
    • Modules
    • Jobs
    • Accessibility
    • Other-Services
    • General-Tips
    • Architecture

Building

Frontend

Frontend theme assets are built with webpack.mix which can be found at the root of the project and in the respective theme under themes/[theme-name]/webpack.mix.js. Each theme can built using npm run [dev or prod] --theme=[theme-name].

Sass rules and variables can be appended to a Sass build by webpack using the additionalData option. This can be particularly useful for JS and Sass to share settings from json configs.
For instance, you can pass the following array to Sass:

mix.sass(`${ __dirname }/scss/app.scss`, 'css', {
    additionalData: `$custom-vars: [${customVars}];`,
})
Edit this page
Prev
Changelog
Next
Tests