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
This is a modified repository of [css-modules-loader-core](https://github.com/css-modules/css-modules-loader-core) with the following changes:
10
+
11
+
1. Rewrite in `Typescript`.
12
+
2. Update some dependencies to latest version: `PostCSS` and related plugins.
13
+
3. Change the usage of `file-system-loader`.
14
+
15
+
The original package depends on `PostCSS@6` which has a different usage of plugins to the latest `PostCSS@8`. Incompatible plugins is the main reason I created this package. You may install the original package if you are not using custom plugins.
16
+
17
+
Usage of this package should be the same as original repo unless you are using `file-system-loader`. Check [here](#file-system-loader) for details.
Processes the input CSS `sourceString`, looking for dependencies such as `@import` or `:import`. Any localisation will happen by prefixing a sanitised version of `sourcePath` When dependencies are found, it will ask the `pathFetcher` for each dependency, resolve & inline any imports, and return the following object:
16
30
@@ -24,16 +38,51 @@ These should map nicely to what your build-tool-specific loader needs to do its
24
38
The default set of plugins is [[postcss-modules-local-by-default](https://github.com/css-modules/postcss-modules-local-by-default), [postcss-modules-extract-imports](https://github.com/css-modules/postcss-modules-extract-imports), [postcss-modules-scope](https://github.com/css-modules/postcss-modules-scope)] (i.e. the CSS Modules specification). This can override which PostCSS plugins you wish to execute, e.g.
// Don't run local-by-default, but use colorFunctions
45
+
// Don't run local-by-default, but use colorFunctions
32
46
// beforehand and autoprefixer afterwards:
33
47
let core =newCore([
34
-
colorFunctions,
35
-
core.plugins.extractImports,
36
-
core.plugins.scope,
48
+
colorFunctions,
49
+
Core.extractImports,
50
+
Core.scope,
37
51
autoprefixer("Last 2 Versions")
38
52
])
39
53
```
54
+
55
+
## File System Loader
56
+
This loader was used only for testing in original repository. However, it doesn't work because the file path is not resolved correctly. See related [issue](https://github.com/css-modules/css-modules-loader-core/issues/232).
57
+
58
+
So I try to fix the bug and end up changing its usage.
59
+
60
+
> P.S. This is tested on Windows only so it may not work on Unix system.
0 commit comments