Webpack engine for Silverstripe without any theme at all. Inspired and HUGE THANK YOU to: andrewhaine/silverstripe-webpack-theme
Installs: 1 863
Open Issues: 1
- silverstripe/framework: ~4.0
- sunnysideup/webpack_requirements_backend: Make it work with Silvertripe
This webpack install allows you to compile any project / vendor/package.
It uses symphony encore to make it fly!
Install this to your themes folder as
sswebpack_engine_only(composer should do this automatically)
Make sure you are on the latest version of node and npm (you could use nvm for this).
npm installin the root folder of module.
examples-from-root-of-projectfolder for the files you need to create.
Expose the dist folder in the public resources folder, using composer, as per usual.
Browse to the root folder of this module and use the following commands:
npm run MY_COMMAND --theme_dir=themes/mytheme`
npm run MY_COMMAND --theme_dir=vendor/myvendor/mypackage/client`
Where MY_COMMAND can be
build(prepare for production).
Good to know
Your theme name can be anything. We use
mythemeas an example name. You can also use this webpack on vendor packages.
style.scssshow you to include JS and CSS from other parts.
themes/mytheme/distfolder for the final output.
themes/mytheme/my_node_modules/to include other modules (using a package.json file inside that folder). You can also include node modules in
mytheme/srcby adding a
package.jsonfile, i.e. running
npm init -y && npm installin the
jQuery has been aliased so that you can use jQuery anywhere without importing it.
jQuery can also be added to the global namespace:
window.jQuery = jquery(untested).
- There is an option to also include an editor file so that you can add it to your TinyMCE HTML Editor. Run the watch / build command you will see the configurations available.