Skip to content

Commit

Permalink
adding prototype structure
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusviniciusLsantos committed Nov 22, 2024
1 parent a452da8 commit fb69027
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,46 @@ import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import svgLoader from 'vite-svg-loader';
import path from 'path';
import { federation } from '@module-federation/vite';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), svgLoader({ defaultImport: 'url' })],
export default defineConfig(async () => ({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
vue: path.resolve(
__dirname,
'./node_modules/vue/dist/vue.runtime.esm-bundler.js',
),
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
'@weni/unnnic-system': path.resolve(
__dirname,
'node_modules/@weni/unnnic-system',
),
},
},
build: {
target: 'chrome89',
},
plugins: [
federation({
name: 'host',
remotes: {
remote: {
type: 'module',
name: 'remote',
entry: 'http://localhost:3001/remoteEntry.js',
entryGlobalName: 'remote',
shareScope: 'default',
},
},
exposes: {},
filename: 'remoteEntry.js',
}),
vue(),
vueJsx(),
svgLoader({ defaultImport: 'url' }),
],
proxy: { '/src/components': 'http://localhost:4174/' },
css: {
preprocessorOptions: {
scss: {
Expand All @@ -27,4 +53,4 @@ export default defineConfig({
},
},
},
});
}));

0 comments on commit fb69027

Please sign in to comment.