@financial-times/dotcom-build-sass 10.1.0 → 10.2.0

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.
@@ -51,6 +51,9 @@ class PageKitSassPlugin {
51
51
  const postcssLoaderOptions = {
52
52
  postcssOptions: {
53
53
  plugins: [
54
+ // Allow @import of CSS files from node_modules
55
+ // https://github.com/postcss/postcss-import
56
+ require('postcss-import')(),
54
57
  // Add vendor prefixes automatically using data from Can I Use
55
58
  // https://github.com/postcss/autoprefixer
56
59
  require('autoprefixer')(autoprefixerOptions),
@@ -63,6 +66,9 @@ class PageKitSassPlugin {
63
66
  implementation: require('postcss')
64
67
  };
65
68
  const cssLoaderOptions = {
69
+ // sass-loader then postcss-loader run first
70
+ // https://github.com/webpack-contrib/css-loader/blob/22e16e2fc88f920571219570953d3da5702d4fdb/README.md?plain=1#L921
71
+ importLoaders: 2,
66
72
  // Allow css-loader to resolve @import because the sass-loader
67
73
  // does not successfully resolve files with a .css extension.
68
74
  import: true,
@@ -452,7 +452,7 @@
452
452
  "affectsGlobalScope": false
453
453
  },
454
454
  "../src/index.ts": {
455
- "version": "1ce57a946d739703fe823574857b093f8ce75836a0b4f6f0a7cdd7869ae61972",
455
+ "version": "749c87ca56b2f3888da51f530532365f42aa9926687931ab0f064c965daf874f",
456
456
  "signature": "74262782cc0e8e7f07d44046b78a6f97239ae1d2282c2763ac54e90f909bbbd5",
457
457
  "affectsGlobalScope": false
458
458
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/dotcom-build-sass",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "",
5
5
  "main": "dist/node/index.js",
6
6
  "types": "dist/node/index.d.ts",
@@ -22,10 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "autoprefixer": "^10.2.5",
25
- "postcss": "^8.4.20",
26
25
  "css-loader": "^3.0.0",
27
26
  "cssnano": "^4.1.10",
28
27
  "mini-css-extract-plugin": "^0.12.0",
28
+ "postcss": "^8.4.20",
29
+ "postcss-import": "^16.1.0",
29
30
  "postcss-loader": "^4.0.0",
30
31
  "sass": "^1.77.2",
31
32
  "sass-embedded": "^1.77.2",
package/src/index.ts CHANGED
@@ -71,6 +71,9 @@ export class PageKitSassPlugin {
71
71
  const postcssLoaderOptions = {
72
72
  postcssOptions: {
73
73
  plugins: [
74
+ // Allow @import of CSS files from node_modules
75
+ // https://github.com/postcss/postcss-import
76
+ require('postcss-import')(),
74
77
  // Add vendor prefixes automatically using data from Can I Use
75
78
  // https://github.com/postcss/autoprefixer
76
79
  require('autoprefixer')(autoprefixerOptions),
@@ -84,6 +87,9 @@ export class PageKitSassPlugin {
84
87
  }
85
88
 
86
89
  const cssLoaderOptions = {
90
+ // sass-loader then postcss-loader run first
91
+ // https://github.com/webpack-contrib/css-loader/blob/22e16e2fc88f920571219570953d3da5702d4fdb/README.md?plain=1#L921
92
+ importLoaders: 2,
87
93
  // Allow css-loader to resolve @import because the sass-loader
88
94
  // does not successfully resolve files with a .css extension.
89
95
  import: true,