Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change name or location of lazy chunks #439

Open
Vortilion opened this issue Aug 30, 2021 · 0 comments
Open

Change name or location of lazy chunks #439

Vortilion opened this issue Aug 30, 2021 · 0 comments

Comments

@Vortilion
Copy link

I am migrating an angularjs-app to angular by at first making it a hybrid application. Using AngularJS 1.6.4, Angular 12, ui-router and ocLazyLoad. There is one module which has to be loaded via lazyLoad after the user loggs in. I managed to achieve that with

`lazyLoad: ['$q', '$ocLazyLoad', function($q, $ocLazyLoad) {
var deferred = $q.defer();

                // Async require => Split point - Webpack does split this into another bundle
                // TODO: Change secure-bundle's location to /secure
                require.ensure([], function () {
                    //
                    // All the code here, plus the required modules
                    // will be bundled in a separate file.
                    var module = require('../secure/config/app.secure.module.ajs');
                    //
                    // OCLazyLoad's 'load' function loads the Angular module.
                    $ocLazyLoad.load({
                        name: 'secure.module'
                    });

                    deferred.resolve(module);
                });
                return deferred.promise;
            }]`

The problem now is: I need to restrict access to this file via SpringSecurity (the frontend is embedded into a war file for a tomcat-server). Because depending on seperate angularCLI-build-configurations the name of the lazy chunk can be different, because it seems that by default it contains the relative-path to the secure-modules'-file in the filename ("frontend-src_app__secure_config_app_secure_module_ajs_js"). So I would love to be able to change the lazy-chunks location and or filename from "/" to sth like "/secure". Is this somehow possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant