После того, как мы настроили приложение, я обнаружил, что команда часов не работает правильно. Если я начну редактировать один из файлов, который import приложение удаленного , в какой-то момент, в каком-то момент
Код: Выделить всё
// [...]
optimization: {
splitChunks: {
chunks: 'all',
},
runtimeChunk: {
name: entrypoint => `runtime-${entrypoint.name}`,
},
},
// [...]
experiments: {
outputModule: true,
},
// [...]
plugins: [
// this part is taken from another project created with Create React App
// the files listed in the entrypoints are then loaded in a Blade partial in Laravel
// using a dedicated helper function
new WebpackManifestPlugin({
fileName: 'asset-manifest.json',
publicPath: '/',
generate: (seed, files, entrypoints) => {
const manifestFiles = files.reduce((manifest, file) => {
manifest[file.name] = file.path;
return manifest;
}, seed);
const entrypointFiles = entrypoints['app'].filter(
fileName => !fileName.endsWith('.map')
);
return {
files: manifestFiles,
entrypoints: entrypointFiles,
};
},
}),
new ModuleFederationPlugin({
name: 'host',
library: { type: 'module' },
filename: 'remoteEntry.js',
remotes: {
remote: 'http://localhost:3001/assets/remoteEntry.js',
},
}),
]
< /code>
И вот как мы используем удаленный: < /p>
const designArea = await import('remote/mountMyDesignArea');
const { default: remoteMountMethod, eventBus } = designArea;
// ...
ожидаемое поведение : я ожидаю, что Runtime-app Code> Code> Code> Code> Code> Code> Code> Code> Code, ссылки на Code, в соответствии с Apply-Manif. Чанк всегда одинаковы (с одним и тем же Chunk Hash ), чтобы я мог использовать манифест для динамического загрузки кусков без необходимости беспокоиться о том, какой из них загружен.
Подробнее здесь: https://stackoverflow.com/questions/795 ... time-chunk