@postcss-go/webpack-loader 0.0.1
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 +21 -0
- package/README.md +57 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 eryue0220
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @postcss-go/webpack-loader
|
|
2
|
+
|
|
3
|
+
Webpack 5 loader for `@postcss-go/core`. It calls the Go-backed processor
|
|
4
|
+
directly and does not depend on `postcss` or the official `postcss-loader`.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i -D @postcss-go/core @postcss-go/webpack-loader webpack
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Add the CSS consumer used by the rest of your Webpack pipeline separately. For
|
|
13
|
+
example, projects that already use `css-loader` can keep it after this loader.
|
|
14
|
+
This package intentionally has no dependency on `postcss` or `postcss-loader`.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
// webpack.config.cjs
|
|
20
|
+
const autoprefixer = require('autoprefixer');
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
module: {
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
test: /\.css$/i,
|
|
27
|
+
use: [
|
|
28
|
+
'css-loader',
|
|
29
|
+
{
|
|
30
|
+
loader: '@postcss-go/webpack-loader',
|
|
31
|
+
options: {
|
|
32
|
+
sourceMap: true,
|
|
33
|
+
postcssOptions: {
|
|
34
|
+
config: false,
|
|
35
|
+
plugins: [autoprefixer()],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`postcssOptions` can also be a synchronous or asynchronous function. It
|
|
47
|
+
receives `mode`, `env`, `file`, `webpackLoaderContext`, and the loader options.
|
|
48
|
+
|
|
49
|
+
When `postcssOptions.config` is omitted, the loader searches from the input
|
|
50
|
+
file for the configuration formats supported by `@postcss-go/core`. Set it to
|
|
51
|
+
`false` to disable lookup or to a path for an explicit config file.
|
|
52
|
+
|
|
53
|
+
The loader preserves previous source maps and forwards PostCSS-shaped warning,
|
|
54
|
+
dependency, context dependency, missing dependency, build dependency, and
|
|
55
|
+
asset messages to Webpack. Custom parsers, syntax implementations,
|
|
56
|
+
stringifiers, and `LazyResult` remain outside the postcss-go compatibility
|
|
57
|
+
boundary.
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@postcss-go/webpack-loader",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Webpack loader for the postcss-go engine.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"README.md",
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@postcss-go/core": "0.0.2"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"webpack": "^5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^22.10.1",
|
|
30
|
+
"css-loader": "^7.1.2",
|
|
31
|
+
"source-map-js": "^1.2.1",
|
|
32
|
+
"typescript": "^6.0.3",
|
|
33
|
+
"unplugin-dts": "^1.0.3",
|
|
34
|
+
"vite": "^8.1.5",
|
|
35
|
+
"vitest": "^3.2.4",
|
|
36
|
+
"webpack": "^5.109.2"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"css",
|
|
40
|
+
"postcss",
|
|
41
|
+
"postcss-go",
|
|
42
|
+
"webpack",
|
|
43
|
+
"webpack-loader"
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/postcss-go/postcss-go.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/postcss-go/postcss-go/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://postcss-go.github.io/",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "vite build",
|
|
59
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:coverage": "vitest run --coverage"
|
|
62
|
+
}
|
|
63
|
+
}
|