https://github.com/fluxter/octobercms-plugin-webpack
OctoberCMS Webpack Plugin
https://github.com/fluxter/octobercms-plugin-webpack
octobercms octobercms-plugin webpack
Last synced: 2 months ago
JSON representation
OctoberCMS Webpack Plugin
- Host: GitHub
- URL: https://github.com/fluxter/octobercms-plugin-webpack
- Owner: Fluxter
- Created: 2020-10-04T21:36:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T19:55:06.000Z (over 5 years ago)
- Last Synced: 2025-06-04T02:39:50.249Z (about 1 year ago)
- Topics: octobercms, octobercms-plugin, webpack
- Language: PHP
- Homepage: https://octobercms.com/plugin/fluxter-webpack
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Webpack Plugin for OctoberCMS
## Prepare your theme
1. Create a themes/[YourTheme]/webpack.config.js (We are using Symfony Webpack Encore)
```js
Encore
.setOutputPath('./assets/build/')
.setPublicPath('/themes/[YourTheme]/assets/build')
```
2. Add the build directory
3. Build your theme
4. Go on by implementing the tags
## Using the plugin
### Implement via functions
Use the following minimal skeleton or adapt it
```html
{{ webpack_styles("app", "assets/build/entrypoints.json") }}
{{ webpack_scripts("app", "assets/build/entrypoints.json") }}
```
### Implement via component
Use the following minimal skeleton or adapt it
```html
[webpackStyles]
entrypointsFile = "assets/build/entrypoints.json" // Default
entrypoint = "app" // Default
[webpackScripts]
entrypointsFile = "assets/build/entrypoints.json" // Default
entrypoint = "app" // Default
==
{% component 'webpackStyles' %}
{% component 'webpackScripts' %}
```
## Configuration
You can configure it, by just change the values given in the examples above. These can be left blank, to use the default values