A nodejs loader for postcss. This allows you to load CSS files into NodeJS programs by converting them into Javascript modules. The returned ES module has a default property whose value is the compiled CSS string.
npm install --save @node-loader/postcssNow run node with the --loader (or --experimental-loader for older NodeJS version) flag:
node --loader @node-loader/postcss file.jsBy default, node-loader postcss looks for a configuration file called postcss.config.js in the current working directory. To specify the file path to the configuration file, provide the POSTCSS_CONFIG environment variable:
POSTCSS_CONFIG=/Users/name/some/dir/.postcssrc node --loader @node-loader/postcss file.jsIf you wish to combine postcss loading with other NodeJS loaders, you may do so by using node-loader-core.