Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vltansky/patchangularpostcss
https://github.com/vltansky/patchangularpostcss
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vltansky/patchangularpostcss
- Owner: vltansky
- License: mit
- Created: 2021-01-29T09:06:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-01T21:24:26.000Z (about 4 years ago)
- Last Synced: 2024-11-17T08:46:49.510Z (3 months ago)
- Language: TypeScript
- Size: 304 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Patch Angular PostCSS
This library exports function that can be used inside custom-webpack to add custom postcss plugins
## API
| name | default | description |
| --------------------- | :-----: | ----------------------: |
| webpackConfig | | Webpack config |
| addPlugins | [] | Array of plugins |
| patchComponentsStyles | `false` | patch components styles |
| patchGlobalStyles | `true` | patch components styles |## Example
`webpack.config.js`:
```
const { patchAngularPostCSS } = require("patch-angular-postcss");module.exports = (config) => {
function patchAngularPostCSS({
webpackConfig: config,
addPlugins: [require('postcss-preset-env'), require('postcss-css-variables')],
patchComponentsStyles: true,
patchGlobalStyles: true,
}
return config;
};
```## Contributing
```bash
npm start # or yarn start
```This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
To do a one-off build, use `npm run build` or `yarn build`.
To run tests, use `npm test` or `yarn test`.
### Bundle Analysis
[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.