Ross
Ross
NNuxt
Created by Ross on 7/10/2024 in #❓・help
ModuleFederationPlugin
I have been asked to implement a ModuleFederationPlugin , I'm new to this all and I can't find any information on doing this with nuxt3. I am also using ssr: false if I add builder: 'webpack' or vite: false (stackoverflow) to the config it does not build. Any help appreciated please. I have tried this in nuxt.config.ts const { ModuleFederationPlugin } = require('webpack').container; export default defineNuxtConfig({ app: { baseURL: '/my_reports/' }, ssr: false, ... build: { output: { filename: 'remoteEntry.js', }, plugins: [ new ModuleFederationPlugin({ name: 'my_report_module', filename: 'remoteEntry.js', exposes: { './my_reports': 'debug', }, shared: { vue: { singleton: true, }, }, }), ], }, });
1 replies
NNuxt
Created by Ross on 7/5/2024 in #❓・help
Redirect to route on value.
I need to integrate with an exisiting system and that will pass information using local store. Because I am using Pinia I am reading the local stor and hydrating Pinia and would then like to redirect to the appropiate route based on a value in local store. I am using CSR const testStore = useTestStore(); // Read from localstorage const testToken = ref(getItem('testToken')); // Save it in Pinia testStore.setTestToken(testToken); const targetRoute = ref(getItem('target')); // How can I redirect to a route based on the contants of target ?
3 replies