diff --git a/.ls-lint.yml b/.ls-lint.yml index 1d80c1a69..afe440728 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -15,6 +15,7 @@ ignore: - .git - public - node_modules + - packages/plugin-postcss/node_modules - packages/plugin-babel/node_modules - packages/init/node_modules - packages/plugin-typescript/node_modules \ No newline at end of file diff --git a/packages/plugin-postcss/README.md b/packages/plugin-postcss/README.md index 904837c03..8d9c5847b 100644 --- a/packages/plugin-postcss/README.md +++ b/packages/plugin-postcss/README.md @@ -52,32 +52,6 @@ export default { ## Options -### Configuration - -To use your own PostCSS configuration, you'll need to create _two (2)_ config files in the root of your project, by which you can provide your own custom plugins / settings that you've installed. -- _postcss.config.js_ -- _postcss.config.mjs_ - -Example: - -```javascript -// postcss.config.js -module.exports = { - plugins: [ - require('postcss-nested') - ] -}; - -// postcss.config.mjs -export default { - plugins: [ - (await import('postcss-nested')).default - ] -}; -``` - -_Eventually once [PostCSS adds support for ESM configuration files](https://github.com/postcss/postcss-cli/issues/387), then this will drop to only needing one file._ - ### Extend Config If you would like to _extend_ the default configuration with your own custom _postcss.config.js_, you can enable the `extendConfig` option of this plugin diff --git a/packages/plugin-postcss/package.json b/packages/plugin-postcss/package.json index a0bb4fe6b..e5cb072e1 100644 --- a/packages/plugin-postcss/package.json +++ b/packages/plugin-postcss/package.json @@ -27,8 +27,8 @@ "@greenwood/cli": "^0.30.0" }, "dependencies": { - "postcss": "^8.3.11", - "postcss-import": "^13.0.0", + "postcss": "^8.4.49", + "postcss-import": "^16.1.0", "postcss-preset-env": "^7.0.1" }, "devDependencies": { diff --git a/packages/plugin-postcss/src/index.js b/packages/plugin-postcss/src/index.js index 305bb21f4..25e9bc241 100644 --- a/packages/plugin-postcss/src/index.js +++ b/packages/plugin-postcss/src/index.js @@ -11,7 +11,7 @@ async function getConfig (compilation, extendConfig = false) { const { projectDirectory } = compilation.context; const configFile = 'postcss.config'; const defaultConfig = (await import(new URL(`./${configFile}.js`, import.meta.url))).default; - const userConfigUrl = new URL(`./${configFile}.mjs`, projectDirectory); + const userConfigUrl = new URL(`./${configFile}.js`, projectDirectory); const userConfig = await checkResourceExists(userConfigUrl) ? (await import(userConfigUrl)).default : {}; diff --git a/packages/plugin-postcss/test/cases/options.extend-config/postcss.config.cjs b/packages/plugin-postcss/test/cases/options.extend-config/postcss.config.cjs deleted file mode 100644 index 80bcddab0..000000000 --- a/packages/plugin-postcss/test/cases/options.extend-config/postcss.config.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: [ - require('postcss-nested') - ] -}; \ No newline at end of file diff --git a/packages/plugin-postcss/test/cases/options.extend-config/postcss.config.mjs b/packages/plugin-postcss/test/cases/options.extend-config/postcss.config.js similarity index 100% rename from packages/plugin-postcss/test/cases/options.extend-config/postcss.config.mjs rename to packages/plugin-postcss/test/cases/options.extend-config/postcss.config.js diff --git a/postcss.config.cjs b/postcss.config.cjs deleted file mode 100644 index 80bcddab0..000000000 --- a/postcss.config.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: [ - require('postcss-nested') - ] -}; \ No newline at end of file diff --git a/postcss.config.mjs b/postcss.config.js similarity index 100% rename from postcss.config.mjs rename to postcss.config.js diff --git a/yarn.lock b/yarn.lock index 92ba84c03..e92a0ac7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12691,6 +12691,11 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanoid@^3.3.7: + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -13928,6 +13933,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" @@ -14133,10 +14143,10 @@ postcss-image-set-function@^4.0.2: dependencies: postcss-values-parser "6.0.1" -postcss-import@^13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-13.0.0.tgz#d6960cd9e3de5464743b04dd8cd9d870662f8b8c" - integrity sha512-LPUbm3ytpYopwQQjqgUH4S3EM/Gb9QsaSPP/5vnoi+oKVy3/mIk2sc0Paqw7RL57GpScm9MdIMUypw2znWiBpg== +postcss-import@^16.1.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-16.1.0.tgz#258732175518129667fe1e2e2a05b19b5654b96a" + integrity sha512-7hsAZ4xGXl4MW+OKEWCnF6T5jqBw80/EE9aXg1r2yyn1RsVEU8EtKXbijEODa+rg7iih4bKf7vlvTGYR4CnPNg== dependencies: postcss-value-parser "^4.0.0" read-cache "^1.0.0" @@ -14364,7 +14374,7 @@ postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0.26, postcss@^7.0. source-map "^0.6.1" supports-color "^6.1.0" -postcss@^8.3, postcss@^8.3.11: +postcss@^8.3: version "8.4.31" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== @@ -14382,6 +14392,15 @@ postcss@^8.4.23: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.49: + version "8.4.49" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" + integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== + dependencies: + nanoid "^3.3.7" + picocolors "^1.1.1" + source-map-js "^1.2.1" + precinct@^11.0.0: version "11.0.5" resolved "https://registry.yarnpkg.com/precinct/-/precinct-11.0.5.tgz#3e15b3486670806f18addb54b8533e23596399ff" @@ -16013,6 +16032,11 @@ source-map-js@^1.0.1, source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"