fix: install autoprefixer and execute SWC after "next build" for compatibility with older browsers

This commit is contained in:
Dorian Niemiec 2024-09-08 18:04:40 +02:00
parent 78cd7521b8
commit cd727b2a19
4 changed files with 1245 additions and 4 deletions

12
.swcrc Normal file
View file

@ -0,0 +1,12 @@
{
"env": {
"targets": [
"chrome 64",
"edge 79",
"firefox 67",
"opera 51",
"safari 12"
]
},
"minify": true
}

1223
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build && swc .next/static/chunks/*.js .next/static/chunks/**/*.js -d . --include-dotfiles",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"lint:fix": "npm run lint -- --fix", "lint:fix": "npm run lint -- --fix",
@ -72,11 +72,13 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^19.4.1", "@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1", "@commitlint/config-conventional": "^19.4.1",
"@swc/cli": "^0.4.0",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^18", "@types/react": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"@types/rss": "^0.0.32", "@types/rss": "^0.0.32",
"@types/validator": "^13.12.1", "@types/validator": "^13.12.1",
"autoprefixer": "^10.4.20",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"eslint": "^8", "eslint": "^8",
@ -96,5 +98,12 @@
"commitizen": { "commitizen": {
"path": "./node_modules/cz-conventional-changelog" "path": "./node_modules/cz-conventional-changelog"
} }
} },
"browserslist": [
"chrome 64",
"edge 79",
"firefox 67",
"opera 51",
"safari 12"
]
} }

View file

@ -1,6 +1,7 @@
/** @type {import('postcss-load-config').Config} */ /** @type {import('postcss-load-config').Config} */
const config = { const config = {
plugins: { plugins: {
autoprefixer: {},
tailwindcss: {}, tailwindcss: {},
}, },
}; };