- Code splitting - via webpack
- Babel 7
- Gulp 4
- scss / postcss
- Remove unused css - via purges
- Fractal pattern library
- SVG symbols
- Handle any static file type, compress images, css, etc
- Integration with craftcms - via ournameismud/fractal
- eslint
- stylelint
- htmlhint
- prettier
- jest
- backstopjs - regression tests
- clone the repo
- install the dependencies (npm install / yarn)
- run
npm run gen-cert
to create https tokens npm run start
will boot up the fractal servernpm run cms
will create a proxy server pointing to your domain namenpm run build:fractal
will generate a fractal ui build you can deploy to netlify withnpm run deploy
npm run build
will create a production build to use with craftcms
src/js/app.js
main entry point for webpacksrc/scss/style.scss
main scss file, includes tailwind importssrc/templates/**
templates for fractalsrc/docs
- documentation files used by fractalstatic
- any static files that should be optimised and move to public. Any SVG prefixed withui-
will become an svg symboldeploy
craftcms lives heredeploy/library
this is where the fractal build is goesdeploy/public
the public root foldertmp
used in dev mode, ienpm start
npm start
npm run cms
npm run build:fractal
npm run build
npm run build:components
npm run build:static
npm run regression:reference
npm run regression:test
npm run regression:approve
npm run test
npm run test:watch
npm run coverage
npm run deploy
npm run gen-cert
npm run lint:js
npm run pretty
npm run generate-docs
The following commands require komp
: https://github.com/FrancisVega/komp (npm i -g komp
)
komp new --template fractal ./components/blob
To create a static site from fractal, create a “pages” folder in the fractal templates directory.
As with all fractal components, each page will need a unique name.
Create a fileName.config.js file for each page
The context object should have a ‘path’ prop that defines the pages pathname. Each generated page will be renamed to index.html and placed in a folder matching the path prop.
i.e about.config.js
module.exports = {
context: {
path: '/about/'
}
}