mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Setup alias for use in standalone chill-bundles project and replace relative paths
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user