Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
agile-package-webpack-plugin
Advanced tools
Agile npm packages that is optimized for production and innerloop
This plugin for Webpack will allow for servers to federation portions of the code. It is useful for server side rendering, in particular.
yarn add -D server-side-module-federation-plugin
or
npm install -D server-side-module-federation-plugin
const ServerSideModuleFederationPlugin = require('server-side-module-federation-plugin');
module.exports = {
entry: {}
output: {
libraryTarget: "commonjs-module",
chunkLoading: "async-http-node",
},
target: 'node',
plugins: [
new ServerSideModuleFederationPlugin({
name: "nameOfYourBundle",
library: {
type: 'commonjs-module'
},
exposes: {
'./exposed1': './src/exposed1'
}
remotes: {
remote1: 'http://some.cdn.com/server/remote1/remote-entry.js',
remote2: 'http://some.othercdn.com/server/remote2/remote-entry.js',
}
});
]
}
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
module.exports = {
entry: {}
plugins: [
new ModuleFederationPlugin({
name: "nameOfYourBundle",
exposes: {
'./exposed1': './src/exposed1'
}
remotes: {
remote1: 'remote1@http://some.cdn.com/client/remote1/remote-entry.js',
remote2: 'remote2@http://some.othercdn.com/client/remote2/remote-entry.js',
}
});
]
}
// App.js
import React, { lazy } from "react";
import Component1 from "remote1/Component1";
const Component2 = lazy(() => import("remote2/Component2"));
export default () => {
return (
<React.Suspense fallback="loading">
<p>
Alice: <Component1 /> is the best!
</p>
<p>
Bob: no, <Component2 /> is the best!
</p>
</React>
);
};
App.js
inside a client bootstrapped code OR server bootstrapped code!git clone https://github.com/kenotron/server-side-module-federation-plugin.git
cd server-side-module-federation-plugin
yarn
yarn start
In another terminal:
yarn workspace app1 test
FAQs
Agile npm packages that is optimized for production and innerloop
We found that agile-package-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.