Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mv3-hot-reload
Advanced tools
Readme
Enable hot reloading for content script and background script (service worker) in MV3.
yarn add mv3-hot-reload
// webpack.config.ts
const isDev = process.env.NODE_ENV === 'development'
function getEntry(name: string) {
return [path.join(srcDir, name), ...(isDev ? [`mv3-hot-reload/${name}`] : [])]
}
const webpackConfig = {
// ...
entry: {
// ...
background: getEntry('background'),
content: getEntry('content'),
},
}
The code for hot reloading will only execute when process.env.NODE_ENV === 'development'
.
// background.ts
import 'mv3-hot-reload/background'
// your code...
// content.ts
import 'mv3-hot-reload/content'
// your code...
package.json
and run it before developmentExample:
"watch:src": "webpack --config webpack/webpack.dev.js --watch",
+ "watch:dist": "mv3-hot-reload",
+ "dev": "concurrently yarn:watch:*",
module.exports = {
// Specify the port of hot reload server, defaults to 9012
port: 9012,
// Specify the directory you want to watch, defaults to 'dist'
directory: 'dist',
// Specifies an array of filenames that should be excluded in watched directory
exclude: [],
}
If you want to set the port, you also need to expose it with process.env.MV3_HOT_RELOAD_PORT
to
the client side.
An example:
// webpack.config.js
const config = require('./mv3-hot-reload.config')
module.exports = {
// ...
plugins: [
new webpack.EnvironmentPlugin({
MV3_HOT_RELOAD_PORT: config.port,
}),
],
}
pacexy/chrome-extension-typescript-starter
The implementation of hot reloading in mv3 refers to theprimone/violet.
MIT
FAQs
Enable hot reloading for content script and background script in MV3.
The npm package mv3-hot-reload receives a total of 2,686 weekly downloads. As such, mv3-hot-reload popularity was classified as popular.
We found that mv3-hot-reload 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.