Skip to content

Commit 617603d

Browse files
committed
feat: init project 🍓
0 parents  commit 617603d

16 files changed

Lines changed: 2376 additions & 0 deletions

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['plugin:@fz6m/sakina/recommended'],
3+
}

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.html linguist-detectable=false
2+
*.js linguist-detectable=false
3+
*.txt linguist-detectable=false
4+
.husky/* linguist-detectable=false
5+
.husky/commit-msg linguist-detectable=false
6+
.husky/pre-commit linguist-detectable=false
7+
.env linguist-detectable=false
8+
*.css linguist-detectable=false
9+
*.scss linguist-detectable=false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/dist
2+
node_modules
3+
.DS_Store

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install cv $1 --emoji --emoji-pos=end

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://registry.npmmirror.com/
2+
3+
update-notifier=false

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 OPQ Open Source Community
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# parcel-css-loader
2+
3+
Speed up your Webpack build with [parcel css](https://github.com/parcel-bundler/parcel-css)
4+
5+
## Install
6+
7+
```bash
8+
pnpm add -D parcel-css-loader
9+
```
10+
11+
## Usage
12+
13+
### Optimize css
14+
15+
webpack config example:
16+
17+
```js
18+
// webpack.config.js
19+
const { ParcelCssMinifyPlugin } = require('parcel-css-loader')
20+
21+
module.exports = {
22+
optimization: {
23+
minimize: true,
24+
minimizer: [
25+
new ParcelCssMinifyPlugin()
26+
]
27+
},
28+
};
29+
```
30+
31+
32+
### Instead postcss-loader
33+
34+
webpack config example:
35+
36+
```diff
37+
// webpack.config.js
38+
39+
module.exports = {
40+
module: {
41+
rules: [
42+
{
43+
test: /\.scss$/,
44+
use: [
45+
'style-loader', // or MiniCssExtractPlugin.loader
46+
'css-loader',
47+
- 'postcss-loader',
48+
+ 'parcel-css-loader',
49+
'sass-loader'
50+
],
51+
},
52+
],
53+
},
54+
};
55+
```
56+
57+
parcel css can only provide `autoprefixer`, if you use custom postcss plugins, it is not recommended to use parcel css instead of postcss
58+
59+
## Config
60+
61+
```js
62+
// webpack.config.js
63+
const { ParcelCssMinifyPlugin } = require('parcel-css-loader')
64+
const parcelCss = require('@parcel/css')
65+
66+
module.exports = {
67+
optimization: {
68+
minimizer: [
69+
new ParcelCssMinifyPlugin({
70+
implementation: parcelCss
71+
// ... parcel css options
72+
})
73+
]
74+
},
75+
};
76+
```
77+
78+
You can see type tips for detailed configurable items
79+
80+
## License
81+
82+
MIT

package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "parcel-css-loader",
3+
"version": "1.0.0",
4+
"main": "dist/index.js",
5+
"description": "Speed up your Webpack build with parcel css",
6+
"keywords": [
7+
"css-loader",
8+
"parcel-css",
9+
"parcel-css-loader",
10+
"parcel",
11+
"webpack-loader",
12+
"webpack-css-minifier"
13+
],
14+
"homepage": "https://github.com/fz6m/parcel-css-loader#README",
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/fz6m/parcel-css-loader"
18+
},
19+
"license": "MIT",
20+
"author": "fz6m",
21+
"files": [
22+
"dist"
23+
],
24+
"scripts": {
25+
"preinstall": "npx only-allow pnpm",
26+
"dev": "tsc --watch",
27+
"build": "rimraf dist && tsc",
28+
"prepare": "husky install",
29+
"prepublishOnly": "pnpm build",
30+
"push": "npm_config_registry=https://registry.npmjs.com/ npm publish"
31+
},
32+
"dependencies": {
33+
"@parcel/css": "^1.3.2",
34+
"safe-buffer": "^5.2.1"
35+
},
36+
"devDependencies": {
37+
"@fz6m/eslint-plugin-sakina": "^1.1.0",
38+
"@types/webpack-sources": "^3.2.0",
39+
"browserslist": "^4.19.3",
40+
"commit-verify": "^1.0.2",
41+
"eslint": "^8.9.0",
42+
"husky": "^7.0.4",
43+
"only-allow": "^1.1.0",
44+
"prettier": "^2.5.1",
45+
"rimraf": "^3.0.2",
46+
"tapable": "^2.2.1",
47+
"typescript": "^4.5.5",
48+
"webpack": "^5.69.1",
49+
"webpack-sources": "^3.2.3"
50+
},
51+
"peerDependencies": {
52+
"webpack": ">=5"
53+
}
54+
}

0 commit comments

Comments
 (0)