Open swuendri opened 1 year ago
I think that setting just loads the node_modules/ids-enterprise/dist/js/cultures
ones with .min.js
instead of js
.
So maybe you could use it if it still works? Or do the same and load the locales in with .min.js
depending what your doing?
But they are published as minfied if you look in node_modules/ids-enterprise/dist/js/cultures
I believe my question wasn't precise enough. Let me try it again.
We want to use the minified culture js files in a Angular project.
Setting the SohoConfig.minifyCultures to true before Soho.Locale will be initialized. We can reach this by putting the following code into index.html
<script>
window["SohoConfig"] = { minifyCultures: true };
</script>
We want to set the usage of minified culture files in the same way we set the path to the cultures itself in our Angular module, before we set/load the current locale. Example:
Soho.Locale.culturesPath = 'assets/ids-enterprise/js/cultures/';
Soho.Locale.minifyCultures = true;
Currently there is no "public" property in Soho.Locale
to force the loading of minified culture files.
But there is a property called minify
in class Locale
of ids-enterprise, which is initialized by the value of SohoConfig.minifyCultures
. And this property is also mentioned as parameter to initialize the Locale
class.
On the other hand Locale.minify
isn't named in ids-enterprise-ng typings SohoLocaleStatic
(https://github.com/infor-design/enterprise-ng/blob/main/projects/ids-enterprise-typings/lib/locale/soho-locale.d.ts). So we cannot easily use the property.
Is it possible to introduce the property minify
in ids-enterprise-ng typings @tmcconechy? Or is the property more of a private one?
@anhallbe, do not merge the PR now. The build of Angular Soho App breaks as expected but the workflow is successful. I will take a look on it.
@anhallbe, I have changed the cli/src/cli.ts
file to return an error in case of unsuccessful build. Should I create a separate PR for this? Or is it okay to change it within this PR?
No the build breaks, which is my expected behavior for the moment. If there is a newer version of enterprise-ng
available with our change, I trigger here again.
You can keep it in the PR
@anhallbe, ids-enterprise-ng
contains our necessary change starting with version 14.7.0. There is currently the first bug fix version available which I introduced here. In my opinion this PR is ready to merge.
This PR is a replacement of #114 to use minified version of themes and cultures in applications generated with
odin new
. See also the issue #118. Thank you to @dohjon for the example!Currently there is no option to include
theme-new*
files only.