Integrate new translations setup
Some checks failed
continuous-integration/drone/tag Build is failing

This commit is contained in:
2025-03-04 14:43:11 +01:00
parent 51cc0254d0
commit 01323ea87a
11 changed files with 114 additions and 61 deletions

View File

@@ -15,7 +15,7 @@ async function* getFiles(dir, depth, ignored) {
const res = resolve(dir, dirent.name);
if (dirent.isDirectory()) {
if (depth > 0) {
yield* getFiles(res, depth - 1, ignored);
yield* getFiles(res, depth - 1, ignored);
}
} else if (ignored.includes(res)) {
continue;
@@ -85,26 +85,28 @@ async function populateConfig(Encore, chillEntries) {
// export the final configuration
module.exports = (async () => {
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
// basic encore configuration
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.enableSassLoader()
.enableVueLoader(() => {}, {
version: 3
})
.enableTypeScriptLoader(function (tsConfig){
tsConfig.appendTsSuffixTo = [/\.vue$/];
tsConfig.appendTsxSuffixTo = [/\.vue$/];
// temporary fix for https://github.com/vuejs/vue-loader/issues/1915 and https://github.com/vuejs/core/issues/2855
tsConfig.compilerOptions = {strict: !Encore.isProduction()};
tsConfig.silent = false;
version: 3,
runtimeCompilerBuild: true,
})
.enableTypeScriptLoader(/*function (tsConfig){
tsConfig.appendTsSuffixTo = [/\.vue$/];
tsConfig.appendTsxSuffixTo = [/\.vue$/];
// temporary fix for https://github.com/vuejs/vue-loader/issues/1915 and https://github.com/vuejs/core/issues/2855
tsConfig.compilerOptions = {strict: !Encore.isProduction()};
tsConfig.compilerOptions.paths = {"translator": [resolve(__dirname, "./assets/translator.ts")]};
tsConfig.silent = false;
}*/)
//.enableForkedTypeScriptTypesChecking()
.autoProvidejQuery()
.enableSourceMaps(!Encore.isProduction())
@@ -113,40 +115,26 @@ 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);
//.addLoader({ test: /\.pdf$/, loader: 'file-loader', options: { name: '[name]_[hash].[ext]', outputPath: 'pdf/' } })
// configure Babel
// .configureBabel((config) => {
// config.plugins.push('@babel/a-babel-plugin');
// })
// enables and configure @babel/preset-env polyfills
// .configureBabelPresetEnv((config) => {
// config.useBuiltIns = 'usage';
// config.corejs = '3.23';
// })
;
// enables Sass/SCSS support
//.enableSassLoader()
Encore.addAliases({
translator: resolve(__dirname, './vendor/chill-project/chill-bundles/assets/translator')
});
// add swagger UI
if (!Encore.isProduction()) {
Encore
.addEntry('swagger', __dirname + '/assets/swagger-ui/index.js')
.addLoader({
test: /\.yaml$/,
type: 'json',
use: [
{ loader: 'json-loader' },
{ loader: 'yaml-loader' }
],
});
}
// populate config with chill entries
let chillEntries = [];
await populateConfig(Encore, chillEntries);
//getting the encore config and appending chill entries
config = Encore.getWebpackConfig();