Fix PostCSS config, convert files to tab

This commit is contained in:
Hans5958 2023-03-22 21:42:43 +07:00
parent 018ecf2e31
commit c0ad176519
3 changed files with 46 additions and 48 deletions

View file

@ -1,5 +1,5 @@
{
"extends": "@parcel/config-default",
"resolvers": ["parcel-resolver-ignore", "..."],
"namers": ["parcel-namer-rewrite", "..."]
"extends": "@parcel/config-default",
"resolvers": ["parcel-resolver-ignore", "..."],
"namers": ["parcel-namer-rewrite", "..."]
}

View file

@ -1,37 +1,37 @@
{
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.1.3",
"@parcel/packager-raw-url": "^2.5.0",
"@parcel/transformer-jsonld": "^2.5.0",
"@parcel/transformer-webmanifest": "^2.5.0",
"parcel": "^2.5.0",
"parcel-namer-rewrite": "^2.0.0-rc.2",
"parcel-resolver-ignore": "^2.1.3",
"postcss": "^8.4.12",
"all-contributors-cli": "^6.23.1"
},
"parcel-namer-rewrite": {
"rules": {
"^(icon-.+)\\.(svg|png|gif|jpg|jpeg)": "_img/pwa/$1.$2",
"^(screenshot-.+)\\.(svg|png|gif|jpg|jpeg)": "_img/pwa/$1.$2",
"(.*)\\.(svg|png|gif|jpg|jpeg)": "_img/$1.$2",
"(.*)\\.(css|woff2?)": "_css/$1{.hash}.$2",
"(.*)\\.(js)": "_js/$1{.hash}.$2"
}
},
"parcelIgnore": [
"pwabuilder-sw-register.js",
"pwabuilder-sw.js"
],
"browserslist": [
">= 0.5%",
"last 2 major versions",
"not dead",
"Chrome >= 60",
"Firefox >= 60",
"Firefox ESR",
"iOS >= 12",
"Safari >= 12",
"not Explorer <= 11"
]
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.1.3",
"@parcel/packager-raw-url": "^2.5.0",
"@parcel/transformer-jsonld": "^2.5.0",
"@parcel/transformer-webmanifest": "^2.5.0",
"parcel": "^2.5.0",
"parcel-namer-rewrite": "^2.0.0-rc.2",
"parcel-resolver-ignore": "^2.1.3",
"postcss": "^8.4.12",
"all-contributors-cli": "^6.23.1"
},
"parcel-namer-rewrite": {
"rules": {
"^(icon-.+)\\.(svg|png|gif|jpg|jpeg)": "_img/pwa/$1.$2",
"^(screenshot-.+)\\.(svg|png|gif|jpg|jpeg)": "_img/pwa/$1.$2",
"(.*)\\.(svg|png|gif|jpg|jpeg)": "_img/$1.$2",
"(.*)\\.(css|woff2?)": "_css/$1{.hash}.$2",
"(.*)\\.(js)": "_js/$1{.hash}.$2"
}
},
"parcelIgnore": [
"pwabuilder-sw-register.js",
"pwabuilder-sw.js"
],
"browserslist": [
">= 0.5%",
"last 2 major versions",
"not dead",
"Chrome >= 60",
"Firefox >= 60",
"Firefox ESR",
"iOS >= 12",
"Safari >= 12",
"not Explorer <= 11"
]
}

View file

@ -1,16 +1,14 @@
const plugins = [];
if (process.env.NODE_ENV === "production") {
plugins.push({
"@fullhuman/postcss-purgecss": {
content: [
'./dist-temp/*.{html,js,svg}',
'./dist-temp/**/*.{html,js,svg}'
]
}
})
}
plugins["@fullhuman/postcss-purgecss"] = {
content: [
'./dist-temp/*.{html,js,svg}',
'./dist-temp/**/*.{html,js,svg}'
]
}
}
module.exports = {
plugins
plugins
};