You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-88Lines changed: 62 additions & 88 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,105 +14,79 @@
14
14
</a>
15
15
</p>
16
16
17
-
Serves as an alternative and also addition to `postcss-loader`. While webpack loaders are efficient, when you need to run some transformations on concatenated CSS (through `mini-css-extract-plugin` for example), loaders allows you to process just one file at time.
18
-
19
-
This plugin tries to solve this issue while taking great inspiration from [postcss-pipeline-webpack-plugin](https://github.com/mistakster/postcss-pipeline-webpack-plugin#readme). It allows you to **run PostCSS plugins** on generated (and newly emitted) **assets**, with support for webpack 5.x **filesystem cache** and ability to change content of **existing assets**, rather than a need to always generate new ones.
17
+
Webpack loaders are pretty cool but limited to process and generate only one file at a time. If you are extracting critical CSS or media queries into separate files, you are no longer able to process these files. This plugin was made to solve this problem.
* Optional: Custom function or RegExp to filter out unwanted assets. Defaults
41
-
* to /\.css$/ to process only CSS files.
42
-
*/
43
-
filter?:RegExp| ((filename:string) => boolean),
44
-
// Optional: Custom implementation of postcss, defaults to require('postcss')
45
-
implementation?:require('postcss'),
46
-
/**
47
-
* Optional: Runs plugin also for newly emitted assets. Should be combined
48
-
* with custom filter option in order to not get stuck processing the same
49
-
* file all over again.
50
-
*/
51
-
additionalAssets?:true|undefined,
52
-
})
53
-
```
24
+
By default the `jsconfig.json` is generated in **current working directory** (this is also where the script looks for existence of `webpack.config.js` or `package.json` file in order to try to extract path aliases).
25
+
26
+
This can be changed by providing path to custom working directory as a **first argument** of the cli (`npx jsconfig.json ~/Workspace/my-project`).
There are few predefined jsconfig.json templates, that can be selected using `-t, --template` argument to help bootstrap the correct environment (`default`[default option], `nextjs`, `react`, `vuejs` and `node`).
These allow you to further overwrite additional defaults or even provide custom `--baseUrl` and `--webpackConfigPath` that are used to generate correct paths to aliases. Lastly `--output` is used to define custom output directory for generated jsconfig.json file (this will not change the path aliases generation in any way). For more options run:
39
+
40
+
```console
41
+
npx jsconfig.json --help
108
42
```
109
43
110
-
This produces following output:
44
+
```console
45
+
Usage: npx jsconfig.json <srcPath> [options]
46
+
47
+
Options:
48
+
--help Show help [boolean]
49
+
--version Show version number [boolean]
50
+
-o, --output Optional custom output directory for generated jsconfig.json
-e, --experimentalDecorators Enables experimental support for proposed ES decorators
65
+
[boolean]
66
+
-s, --syntheticImports Allow default imports from modules with no default export.
67
+
This does not affect code emit, just type checking. [boolean]
111
68
```
112
69
70
+
### Support
71
+
- Node.js >= **12.x**
72
+
73
+
74
+
## Contributions
75
+
76
+
Contributions of any kind are very welcome!
77
+
78
+
This repository uses **conventional commits** in order to correctly generate CHANGELOG and release automatically. This means that all commits should follow correct form defined in the conventional commits specification. To make this process easier (and since there's pre-commit hook to validate commit messages. which won't let you commit invalid messages) you can run commit wizard using:
79
+
113
80
```
81
+
npm run commit
82
+
```
83
+
84
+
Which will take you through the process of generating correct format of the commit message.
85
+
86
+
### Development
87
+
88
+
To run cli in development you can use `npm run dev` to fires up nodemon which watches changes over the source files. By default the result is written to tmp/jsconfig.json when using nodemon (this looks int the root directory of the repository for webpack configs, you can provide custom webpack config while developing using CLI options `npm run dev -- --webpackConfig=/tmp/custom.webpack.test.config.js`).
89
+
90
+
### Tests
114
91
115
-
## Support
116
-
- Node.js >= 14
117
-
- postcss >= 8
118
-
- webpack >= 5
92
+
Tests are written using [jest framework](https://jestjs.io/). To run them use either `npm run test` or `npm run test:unit`, `npm run test e2e` to run each set of tests separately.
0 commit comments