
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@gasket/plugin-webpack
Advanced tools
Adds Webpack support to your application.
npm i @gasket/plugin-webpack
Update your gasket file plugin configuration:
// gasket.js
+ import pluginWebpack from '@gasket/plugin-webpack';
export default makeGasket({
plugins: [
+ pluginWebpack
]
});
The Webpack plugin is configured using the gasket.js file.
First, add it to the plugins section of your gasket.js:
export default makeGasket({
plugins: {
pluginWebpack
}
});
If your app was previously using the webpack property in the
gasket.js, you should update your configuration to use the
webpackConfig lifecycle instead.
This action can be used by plugins that need to gather Webpack configuration.
// Any starting Webpack configuration
const initialConfig = { };
// Any additional context such as isServer or not
const context = { isServer: true };
const webpackConfig = gasket.actions.getWebpackConfig(initialConfig, context);
This action will execute the webpackConfig lifecycle and return the final
Webpack configuration object.
Executed by getWebpackConfig action, it receives three parameters:
webpack - The Webpack API....additionalContext - Additional context may be exposed. For example, in next.js apps, the next.js webpack config options are included.A hook should return a new Webpack config object derived from the original. The usage of webpack-merge is recommended when doing so since it can properly handle the overloaded types within Webpack config properties, which can be tricky.
import webpackMerge from 'webpack-merge';
export default {
name: 'sample-plugin',
hooks: {
webpackConfig: function webpackConfigHook( gasket, config, context) {
const { isServer, webpack } = context;
return isServer
? config
: webpackMerge.merge(config, {
plugins: [
new webpack.DefinePlugin({
MEANING_OF_LIFE: 42
})
]
});
}
}
};
For more details, see the additional webpack documentation.
This plugin automatically prevents process.env.GASKET_ENV from being bundled in browser code to avoid exposing server-side configuration. If detected, the build will fail with a helpful error message.
Instead of using process.env.GASKET_ENV in any code:
Use gasket.config.env for environment-specific configuration:
// gasket.js
export default makeGasket({
environments: {
dev: { apiUrl: 'http://localhost:3000' },
prod: { apiUrl: 'https://api.example.com' }
}
});
Use @gasket/data to pass server data to the client:
// Server-side (in a lifecycle hook)
export default {
name: 'config-plugin',
hooks: {
publicGasketData(gasket, data) {
return {
...data,
apiUrl: gasket.config.apiUrl,
env: gasket.config.env
};
}
}
};
// Client-side
import { gasketData } from '@gasket/data';
const { apiUrl } = gasketData();
Move environment logic to server-side code and expose only necessary data through APIs or @gasket/data.
For more guidance, see the environment configuration recipes.
FAQs
Adds webpack support to your application
The npm package @gasket/plugin-webpack receives a total of 107 weekly downloads. As such, @gasket/plugin-webpack popularity was classified as not popular.
We found that @gasket/plugin-webpack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.