I work with angular 2 and angular cli.
I want to load external module packaged with webpack.
I'have try do it with Ajax and eval, but this doesn't work. My app and the external module have same dependecies to angular, this doesn't work.
I must load dynamicly module, because i can't know on build wich module will be used.
Someone have an idea to load a webpack js file, on ajax?
Thank's
Related
My cypress tests work great on my local machine (Windows) using chrome or headless, but when I try to run things in GitHub Actions environment (ubuntu-18.04), some of the tests pass, but most fail because the CSS doesn't get loaded, and elements are covered up, etc.
My stack includes a node.js Express server that serves a pre-built Vue CLI/Vuetify frontend as static content.
Anybody had a similar issue?
Thanks!
You can find meaning of code busting at https://www.keycdn.com/support/what-is-cache-busting
The main point is that when new version is deployed, uses should use new feature with avoiding cache feature.
My app is deployed with Universal SSR and using scss.
I checked deployed files and css codes was included at html so css is not related to cache busting.
Also, I checked js file and whenever the js file is builed, the filename seems changed with some random string. I think it support cache busting on js file.
My conclusion is that nuxt support cache busting. Am I right? If then, Can you give proper reference on nuxt website or webpack configuration codes on github??
Thank you!
So i have a laravel application that i built and is live using Laravel without Vue.js. Now, finding out about vue.js and its lightweight + numerous additional features for improved user experience, i have decided to include it and rebuild my app into components with much better reactivity.
The only issue is, with my little research, i found out that the main vue element in the resources/js/app.js points to an #app element in views/layouts/app.blade.php which would be fine if perhaps i had an SPA or and MPA that starts from there.
However, in my implementation i have different layout files for both back end and user section of my app, and i don't know how to go about it ( which element to point the vue object to).
Here's what i would like to have though, if possible. I would want a commons.js to have all my common components and imports and perhaps a [page].js for pages where i would need a bit more.
Thanks in advance!
I figured out how to handle this.
The Vue instance created in the app.js doesn't have to be your only instance. In MPA's you will most like have multiple vue instances, perhaps on per page. To keep my code clean, i kept the dependencies common to my whole application in app.js.
For my portals, each portal has a commons.js which containts dependencies specific to the management of my application and hence dont need to be loaded when the user is surfing my up. I set to bundle with webpack and include in all portal pages.
Furthermore, each page has a page.js which is also bundled and included only page specific dependencies (components etc) and a vue instance for each page.
By using this architecture i reduce the JS needed to be loaded to only the necessary on both portal pages and the main app for users.
Hope this helps someone! Happy coding.
I'm trying to build my first Nativescript vue app based on/complimenting a previously existing web app. In that app I use the FlipClock.js.
I'd like to find a way to continue using this library for simplicity and consistency on the UI in my native app. There is a vue-flipclock component, but it still generates HTML which creates errors in the NativeScript app.
CONSOLE LOG file:///app/vendor.js:34096:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.2.0)} -> CreateElement(div)'
***** Fatal JavaScript exception - application has been terminated. *****
Is there someway I can make this work inside the NativeSCript app, or do I need to find a different component altogether?
No, you can't use any plugin that depends on browser specific features / HTML DOM in NativeScript environment where your UI is totally native.
You might use a WebView if you want to load simple web app that might showcase the flipclock.
I am making a website in Codeigniter and not using any client side framework like angularJS. However I need some features of angularJS like downloading the JS and CSS once at the client rather than downloading it for each page. As my website content is much dependent on the server, should I use angularJS? I read that it makes tha application slower.
your question is not about angular at all!
I recommend you to read something about build systems like require, grunt, yeoman...
What you want to do is ajaxifying your website, as Stever said it's not about angular at all..
you may use RequireJS to load the script when a page need it.
For a best perfomance, use grunt for running any task like : minifying, compressing your stylesheet and so on..