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, asynchronously resolve & inline any imports, and return the following object:
injectableSource: the final, merged CSS file without @import or :import statements
exportTokens: the mapping from local name to scoped name, as described in the file's :export block
These should map nicely to what your build-tool-specific loader needs to do its job.
Sync API
The sync API is available at css-modules-loader-core/sync
import Core from 'css-modules-loader-core/sync'let core = new Core()
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, synchronously resolve & inline any imports, and return the following object:
injectableSource: the final, merged CSS file without @import or :import statements
exportTokens: the mapping from local name to scoped name, as described in the file's :export block
These should map nicely to what your build-tool-specific loader needs to do its job.
import Core from 'css-loader-core'import autoprefixer from 'autoprefixer'import colorFunctions from 'postcss-color-function'// Don't run local-by-default, but use colorFunctions // beforehand and autoprefixer afterwards:let core = new Core([ colorFunctions, core.plugins.extractImports, core.plugins.scope, autoprefixer("Last 2 Versions")])