@davidsneighbour/postcss-config 3.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +9 -0
- package/README.md +62 -0
- package/index.js +32 -0
- package/package.json +30 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Patrick Kollitsch / David's Neighbour
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## @davidsneighbour/postcss-config
|
|
2
|
+
|
|
3
|
+
### Installation
|
|
4
|
+
|
|
5
|
+
Use npm to install this package as development dependency:
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install --save-dev @davidsneighbour/postcss-config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Configuration
|
|
12
|
+
|
|
13
|
+
Create `postcss.config.js` with the following content:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const config = require("@davidsneighbour/postcss-config");
|
|
17
|
+
module.exports = config;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
[More information about PostCSS configuration](https://github.com/postcss/postcss).
|
|
21
|
+
|
|
22
|
+
### Configuration rules in this package
|
|
23
|
+
|
|
24
|
+
To be written ...
|
|
25
|
+
|
|
26
|
+
### Note about using PostCSS in [GoHugo](https://gohugo.io)
|
|
27
|
+
|
|
28
|
+
GoHugo is weird, but great. To get PostCSS to work with GoHugo the `postcss-cli` package needs to be installed in the
|
|
29
|
+
project itself and is not handled through this configuration. Run the following to get PostCSS working in GoHugo:
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
npm install --save-dev postcss-cli
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A global `postcss-cli` installation won't work if the plugins in this package are not installed globally as well.
|
|
36
|
+
|
|
37
|
+
<!--- CONFIGURATIONS BEGIN --->
|
|
38
|
+
|
|
39
|
+
## davidsneighbour/Configurations
|
|
40
|
+
|
|
41
|
+
A collection of configurations for website development at DNB Org.
|
|
42
|
+
|
|
43
|
+
<!-- prettier-ignore -->
|
|
44
|
+
| Package | Description |
|
|
45
|
+
| --- | ---- |
|
|
46
|
+
| [babel-config](https://github.com/davidsneighbour/configurations/tree/main/packages/babel-config) | [Babel](https://babeljs.io/) configuration |
|
|
47
|
+
| [bootstrap-config](https://github.com/davidsneighbour/configurations/tree/main/packages/bootstrap-config) | [Bootstrap](https://getbootstrap.com/) configuration |
|
|
48
|
+
| [browserslist-config](https://github.com/davidsneighbour/configurations/tree/main/packages/browserslist-config) | [Browserslist](https://github.com/browserslist/browserslist) configuration |
|
|
49
|
+
| [commitlint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/commitlint-config) | [Commitlint](https://github.com/conventional-changelog/commitlint) configuration |
|
|
50
|
+
| [cssnano-config](https://github.com/davidsneighbour/configurations/tree/main/packages/cssnano-config) | [CSSnano](https://cssnano.co/) configuration |
|
|
51
|
+
| [cypress-config](https://github.com/davidsneighbour/configurations/tree/main/packages/cypress-config) | [Cypress](https://www.cypress.io/) configuration |
|
|
52
|
+
| [eslint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/eslint-config) | [ESLint](https://github.com/eslint/eslint) configuration |
|
|
53
|
+
| [postcss-config](https://github.com/davidsneighbour/configurations/tree/main/packages/postcss-config) | [PostCSS](https://postcss.org/) configuration |
|
|
54
|
+
| [prettier-config](https://github.com/davidsneighbour/configurations/tree/main/packages/prettier-config) | [Prettier](https://prettier.io/) configuration |
|
|
55
|
+
| [remark-config](https://github.com/davidsneighbour/configurations/tree/main/packages/remark-config) | [ReMark](https://github.com/remarkjs/remark-lint) configuration |
|
|
56
|
+
| [standard-version-config](https://github.com/davidsneighbour/configurations/tree/main/packages/standard-version-config) | [Standard Version](https://github.com/conventional-changelog/standard-version) configuration |
|
|
57
|
+
| [stylelint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/stylelint-config) | [StyleLint](https://github.com/stylelint/stylelint) configuration |
|
|
58
|
+
| [textlint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/textlint-config) | [TextLint](https://github.com/textlint/textlint) configuration |
|
|
59
|
+
| [webpack-config](https://github.com/davidsneighbour/configurations/tree/main/packages/webpack-config) | [Webpack](https://webpack.js.org/) configuration |
|
|
60
|
+
| [tools](https://github.com/davidsneighbour/configurations/tree/main/packages/tools) | Tools |
|
|
61
|
+
|
|
62
|
+
<!--- CONFIGURATIONS END --->
|
package/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const cssnano = require("cssnano");
|
|
2
|
+
const purgecss = require("@fullhuman/postcss-purgecss");
|
|
3
|
+
const stylelint = require("stylelint");
|
|
4
|
+
const postcsspresetenv = require("postcss-preset-env");
|
|
5
|
+
const autoprefixer = require("autoprefixer");
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
plugins: [
|
|
9
|
+
purgecss({
|
|
10
|
+
content: ["./hugo_stats.json"],
|
|
11
|
+
defaultExtractor: (content) => {
|
|
12
|
+
const els = JSON.parse(content).htmlElements;
|
|
13
|
+
return els.tags.concat(els.tags, els.classes, els.ids);
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
stylelint(),
|
|
17
|
+
autoprefixer(),
|
|
18
|
+
postcsspresetenv({
|
|
19
|
+
stage: 2
|
|
20
|
+
}),
|
|
21
|
+
cssnano({
|
|
22
|
+
preset: [
|
|
23
|
+
"default",
|
|
24
|
+
{
|
|
25
|
+
discardComments: {
|
|
26
|
+
removeAll: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@davidsneighbour/postcss-config",
|
|
3
|
+
"version": "3.5.10",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Postcss configuration for davidsneighbour projects.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Patrick Kollitsch",
|
|
8
|
+
"email": "patrick@davids-neighbour.com",
|
|
9
|
+
"web": "https://davids-neighbour.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": "git+https://github.com/davidsneighbour/configurations/",
|
|
12
|
+
"bugs": "git+https://github.com/davidsneighbour/configurations/issues",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@fullhuman/postcss-purgecss": "^4.1.3",
|
|
15
|
+
"autoprefixer": "^10.4.4",
|
|
16
|
+
"cssnano": "^5.1.7",
|
|
17
|
+
"postcss": "^8.4.12",
|
|
18
|
+
"postcss-cli": "^9.1.0",
|
|
19
|
+
"postcss-import": "^14.1.0",
|
|
20
|
+
"postcss-loader": "^6.2.1",
|
|
21
|
+
"postcss-nesting": "^10.1.4",
|
|
22
|
+
"postcss-preset-env": "^7.4.3"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=16",
|
|
26
|
+
"npm": ">=7"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "55c20949cd12651b0dfc600b5b316c8a42776506",
|
|
29
|
+
"main": "index.js"
|
|
30
|
+
}
|