Skip to content

Commit fcebd63

Browse files
committed
Build frontend assets
1 parent 33e2d37 commit fcebd63

8 files changed

Lines changed: 5507 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/public/
1313
/var/
1414
/vendor/
15+
/node_modules/
1516
.DS_Store
1617
.vagrant
1718
.phpunit.result.cache

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ You can get a list of all installed phpList modules with this command:
151151
composer run-script list-modules
152152
```
153153

154+
To compile and publish the `phplist/web-frontend` assets into
155+
`public/build` (used by the web frontend Twig templates),
156+
run:
157+
158+
```bash
159+
composer run-script build-web-frontend-assets
160+
```
161+
154162

155163
## Creating a .tar.gz package of this distribution
156164

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@
9090
"php bin/console cache:clear",
9191
"php bin/console cache:warmup"
9292
],
93+
"build-web-frontend-assets": [
94+
"yarn install",
95+
"yarn build:web-frontend"
96+
],
9397
"post-install-cmd": [
9498
"@create-directories",
9599
"@update-configuration"

composer.lock

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"build:web-frontend": "encore production",
5+
"watch:web-frontend": "encore dev --watch"
6+
},
7+
"devDependencies": {
8+
"@babel/core": "^7.27.4",
9+
"@babel/preset-env": "^7.27.2",
10+
"@symfony/webpack-encore": "^5.1.0",
11+
"@tailwindcss/postcss": "^4.2.1",
12+
"@vue/compiler-sfc": "^3.5.16",
13+
"autoprefixer": "^10.4.27",
14+
"babel-loader": "^10.0.0",
15+
"copy-webpack-plugin": "^12.0.2",
16+
"file-loader": "^6.0.0",
17+
"postcss": "^8.5.6",
18+
"postcss-loader": "^8.1.0",
19+
"tailwindcss": "^4.2.1",
20+
"vue-loader": "^17.3.1",
21+
"webpack": "5.104.1",
22+
"webpack-cli": "^5.1.4",
23+
"webpack-notifier": "^1.15.0"
24+
},
25+
"dependencies": {
26+
"@ckeditor/ckeditor5-vue": "^7.4.0",
27+
"@tatevikgr/rest-api-client": "^2.0.5",
28+
"apexcharts": "^5.10.4",
29+
"ckeditor5": "^48.0.0",
30+
"vue": "^3.5.16",
31+
"vue-router": "4",
32+
"vue3-apexcharts": "^1.11.1"
33+
}
34+
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: [
3+
require('@tailwindcss/postcss'),
4+
require('autoprefixer'),
5+
],
6+
};

webpack.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const Encore = require('@symfony/webpack-encore');
2+
const path = require('path');
3+
4+
if (!Encore.isRuntimeEnvironmentConfigured()) {
5+
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
6+
}
7+
8+
Encore
9+
.setOutputPath('public/build/')
10+
.setPublicPath('/build')
11+
.addEntry('app', './vendor/phplist/web-frontend/assets/app.js')
12+
.addStyleEntry('styles', './vendor/phplist/web-frontend/assets/styles/app.css')
13+
.enableVueLoader(() => {}, { version: 3 })
14+
.enableSingleRuntimeChunk()
15+
.enablePostCssLoader()
16+
.copyFiles({
17+
from: './vendor/phplist/web-frontend/assets/images',
18+
to: 'images/[path][name].[hash:8].[ext]',
19+
})
20+
.addAliases({
21+
'@': path.resolve(__dirname, 'vendor/phplist/web-frontend/assets'),
22+
'@images': path.resolve(__dirname, 'vendor/phplist/web-frontend/assets/images'),
23+
})
24+
;
25+
26+
module.exports = Encore.getWebpackConfig();

0 commit comments

Comments
 (0)