Setup alias for use in standalone chill-bundles project and replace relative paths

This commit is contained in:
2025-02-19 10:57:59 +00:00
committed by Julien Fastré
parent c89e3785ef
commit d2fcb6945b
42 changed files with 924 additions and 9449 deletions

View File

@@ -1,5 +1,6 @@
const Encore = require("@symfony/webpack-encore");
const { resolve, parse } = require("path");
const {existsSync} = require("fs");
const { readdir } = require("fs").promises;
/**
@@ -92,25 +93,19 @@ module.exports = (async () => {
.enableVersioning()
.enableSingleRuntimeChunk()
.splitEntryChunks();
// added when upgrading to symfony 5.4
// enables and configure @babel/preset-env polyfills
//.configureBabelPresetEnv((config) => {
// config.useBuiltIns = 'usage';
// config.corejs = '3.23';
//})
//.addLoader({ test: /\.pdf$/, loader: 'file-loader', options: { name: '[name]_[hash].[ext]', outputPath: 'pdf/' } })
// populate config with chill entries
let chillEntries = [];
await populateConfig(Encore, chillEntries);
// configure Babel
// .configureBabel((config) => {
// config.plugins.push('@babel/a-babel-plugin');
// })
//getting the encore config and appending chill entries
config = Encore.getWebpackConfig();
config.entry.chill = chillEntries;
Encore.addAliases({
translator: resolve(__dirname, './assets/translator'),
"@symfony/ux-translator": resolve(__dirname, './vendor/symfony/ux-translator/assets'),
});
//getting the encore config and appending chill entries
config = Encore.getWebpackConfig();
config.entry.chill = chillEntries;
if (!Encore.isProduction()) {
console.log(config);