Skip to content

updated packages to remove security issue: Cross-site Scripting (XSS) in serialize-javascript #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": "commonjs",
"targets": {
"node": "current"
}
}
]
]
}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
yarn-error.log
.next/
12,017 changes: 8,348 additions & 3,669 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-pwa",
"version": "5.6.0",
"version": "5.7.0",
"description": "Next.js with PWA, powered by workbox.",
"main": "index.js",
"repository": "https://github.com/shadowwalker/next-pwa",
@@ -14,21 +14,30 @@
"web",
"service-worker"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "webpack --config webpack.config.js --mode=production",
"prepublishOnly": "npm run build"
},
"dependencies": {
"babel-loader": "^8.2.5",
"clean-webpack-plugin": "^4.0.0",
"globby": "^11.0.4",
"terser-webpack-plugin": "^5.3.3",
"workbox-webpack-plugin": "^6.5.4",
"workbox-window": "^6.5.4"
"terser-webpack-plugin": "^5.3.11",
"workbox-webpack-plugin": "^7.3.0",
"workbox-window": "^7.3.0"
},
"devDependencies": {
"webpack": "^5.74.0"
"node-polyfill-webpack-plugin": "^2.0.1",
"webpack": "^5.74.0",
"webpack-cli": "^6.0.1"
},
"peerDependencies": {
"next": ">=9.0.0"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "5.18.0"
}
}
}
60 changes: 60 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const path = require('path');
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");

module.exports = {
mode: 'production',
entry: './index.js', // Your package’s entry point
output: {
filename: 'next-pwa.bundle.js',
path: path.resolve(process.cwd(), 'dist'),
libraryTarget: 'commonjs2'
},
resolve: {
fallback: {
fs: false,
module: false,
dgram: false,
dns: false,
net: false,
tls: false,
child_process: false,
worker_threads: false,
async_hooks: false,
inspector: false,
"uglify-js": false,
"@swc/core": false,
esbuild: false
}
},
plugins: [
// This plugin polyfills Node core modules where needed.
new NodePolyfillPlugin()
],
// Disable performance hints to suppress asset size warnings
performance: {
hints: false
},
// Optionally ignore known critical dependency warnings
ignoreWarnings: [
{
// Ignore dynamic require warnings from jest-worker
module: /node_modules[\\/]jest-worker[\\/]/,
message: /Critical dependency: the request of a dependency is an expression/
},
{
// Ignore warnings from loader-runner
module: /node_modules[\\/]loader-runner[\\/]/,
message: /Critical dependency: the request of a dependency is an expression/
},
{
// Ignore warnings from terser-webpack-plugin’s dynamic require usage
module: /node_modules[\\/]terser-webpack-plugin[\\/]/,
message: /Critical dependency: require function is used in a way in which dependencies cannot be statically extracted/
},
{
// Ignore other dynamic require warnings from webpack internals
module: /node_modules[\\/]webpack[\\/]/,
message: /Critical dependency: the request of a dependency is an expression/
}
]
};