Starter kit for SilverStripe 4, Webpack 2 and Bootstrap 4.
Installation is via Composer.
Create a new project based on this repo by running:
$ composer create-project praxisnetau/silverstripe-webpack2-starter /path/to/project dev-master
Alternatively, clone the repo, and then run:
$ composer install
Once Composer has finished downloading packages, you'll need to create a
.env file either in the project root, or the
parent directory. An example file
.env.example is included in the repo to give you a head start. The
configures the environment and database settings for SilverStripe 4. Make sure you don't commit any
.env files with
sensitive information (such as passwords) to version control!
You'll also need to install the frontend dependencies in the
themes/app folder. You can either use Yarn or NPM to
$ cd themes/app $ yarn install
$ cd themes/app $ npm install
Once the frontend dependencies are installed in
node_modules, you'll need to start the Webpack development server:
$ yarn run start
$ npm run start
If everything goes according to plan, the Webpack development server should start running on
Webpack will compile the theme source files.
You can now access your app host in your browser. SilverStripe will build it's database, and CSS changes will be hot loaded by Webpack.
The theme uses
modernizr-loader for easy customisation of your theme via configuration files:
themes/app/.bootstraprc- YAML configuration for Bootstrap
themes/app/.modernizrrc- YAML configuration for Modernizr
Using these files, you can selectively enable or disable features of both Bootstrap and Modernizr for your custom app build.
To prepare files for distribution to production servers, you can run Webpack in production mode by using:
$ yarn run build
$ npm run build
Webpack will clear your
When deploying your project to a live server, you do not need to deploy the
themes/app/source folder. Only deploy