sunnysideup / sswebpack_engine_only
Webpack engine for Silverstripe without any theme at all. Use this with any theme / module you are building. You can also use it without SilverStripe at all.
Installs: 2 603
Dependents: 18
Suggesters: 1
Security: 0
Stars: 3
Watchers: 5
Forks: 1
Open Issues: 1
Language:Shell
Type:silverstripe-theme
Suggests
- silverstripe/framework: Use with ^4.0 || ^5.0
- sunnysideup/webpack_requirements_backend: Use with dev-master (or any version) To make it work with Silvertripe
- dev-master
- 14.4.1
- 14.4.0
- 14.3.0
- 14.2.9
- 14.2.8
- 14.2.7
- 14.2.6
- 14.2.5
- 14.2.4
- 14.2.3
- 14.2.2
- 14.2.1
- 14.2.0
- 14.1.0
- 14.0.0
- 13.0.0
- 12.0.1
- 12.0.0
- 11.0.0
- 10.0.0
- 9.0.1
- 9.0.0
- 8.2.0
- 8.1.0
- 8.0.0
- 7.1.0
- 7.0.0
- 6.1.1
- 6.1.0
- 6.0.0
- 5.2.0
- 5.1.0
- 5.0.0
- 4.0.0
- 3.x-dev
- 3.1.0
- 3.0.1
- 3.0.0
- 2.0.0
- 1.0.0
- dev-vuejs
- dev-feature/symphony
- dev-latest
- dev-dev-4.1-upgrade
This package is auto-updated.
Last update: 2024-10-11 09:14:53 UTC
README
This webpack install allows you to compile any project / vendor/package.
It uses symphony encore to make it fly!
Installation
-
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).
-
run
npm install
in the root folder of module. -
See the
examples-from-root-of-project
folder 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:
Usage
npm run MY_COMMAND --theme_dir=themes/mytheme`
OR
npm run MY_COMMAND --theme_dir=vendor/myvendor/mypackage/client`
Where MY_COMMAND can be
dev
(debug),watch
(develop), orbuild
(prepare for production).
Good to know
required structure
-
Your theme name can be anything. We use
mytheme
as an example name. You can also use this webpack on vendor packages. -
the
main.js
andstyle.scss
show you to include JS and CSS from other parts. -
Add a
themes/mytheme/dist
folder for the final output. -
Add a
themes/mytheme/my_node_modules/
to include other modules (using a package.json file inside that folder). You can also include node modules inmytheme/src
by adding apackage.json
file, i.e. runningnpm init -y && npm install
in themytheme/src
folder.
jQuery
-
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).
Editor File
- 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.
including the build files:
Here is how to include the files efficiently:
- add
sunnysideup/webpack_requirements_backend:dev-master
using composer - check out its documentation on how to add the required files.