@parcel/transformer-sass 2.8.2 → 2.8.4-nightly.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.
@@ -75,7 +75,7 @@ var _default = new (_plugin().Transformer)({
75
75
  config,
76
76
  options
77
77
  }) {
78
- let configFile = await config.getConfig(['.sassrc', '.sassrc.json', '.sassrc.js', '.sassrc.cjs'], {
78
+ let configFile = await config.getConfig(['.sassrc', '.sassrc.json', '.sassrc.js', '.sassrc.cjs', '.sassrc.mjs'], {
79
79
  packageKey: 'sass'
80
80
  });
81
81
  let configResult = configFile ? configFile.contents : {}; // Resolve relative paths from config file
@@ -84,10 +84,6 @@ var _default = new (_plugin().Transformer)({
84
84
  configResult.includePaths = configResult.includePaths.map(p => _path().default.resolve(_path().default.dirname(configFile.filePath), p));
85
85
  }
86
86
 
87
- if (configFile && _path().default.extname(configFile.filePath).endsWith('js')) {
88
- config.invalidateOnStartup();
89
- }
90
-
91
87
  if (configResult.importer === undefined) {
92
88
  configResult.importer = [];
93
89
  } else if (!Array.isArray(configResult.importer)) {
@@ -224,7 +220,9 @@ function resolvePathImporter({
224
220
  }
225
221
 
226
222
  try {
227
- const filePath = await resolve(prev, u);
223
+ const filePath = await resolve(prev, u, {
224
+ packageConditions: ['sass', 'style']
225
+ });
228
226
 
229
227
  if (filePath) {
230
228
  const contents = await asset.fs.readFile(filePath, 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/transformer-sass",
3
- "version": "2.8.2",
3
+ "version": "2.8.4-nightly.0+7b79c6d",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,12 +17,12 @@
17
17
  "source": "src/SassTransformer.js",
18
18
  "engines": {
19
19
  "node": ">= 12.0.0",
20
- "parcel": "^2.8.2"
20
+ "parcel": "2.8.4-nightly.0+7b79c6d"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/plugin": "2.8.2",
23
+ "@parcel/plugin": "2.8.4-nightly.0+7b79c6d",
24
24
  "@parcel/source-map": "^2.1.1",
25
25
  "sass": "^1.38.0"
26
26
  },
27
- "gitHead": "3437f64e4c6f57d911614c480b742e229149f200"
27
+ "gitHead": "7b79c6d69ffabef89810a8db61e9abdeb70d6990"
28
28
  }
@@ -12,7 +12,7 @@ const NODE_MODULE_ALIAS_RE = /^~[^/\\]/;
12
12
  export default (new Transformer({
13
13
  async loadConfig({config, options}) {
14
14
  let configFile = await config.getConfig(
15
- ['.sassrc', '.sassrc.json', '.sassrc.js', '.sassrc.cjs'],
15
+ ['.sassrc', '.sassrc.json', '.sassrc.js', '.sassrc.cjs', '.sassrc.mjs'],
16
16
  {
17
17
  packageKey: 'sass',
18
18
  },
@@ -27,10 +27,6 @@ export default (new Transformer({
27
27
  );
28
28
  }
29
29
 
30
- if (configFile && path.extname(configFile.filePath).endsWith('js')) {
31
- config.invalidateOnStartup();
32
- }
33
-
34
30
  if (configResult.importer === undefined) {
35
31
  configResult.importer = [];
36
32
  } else if (!Array.isArray(configResult.importer)) {
@@ -163,7 +159,9 @@ function resolvePathImporter({asset, resolve, includePaths, options}) {
163
159
  u = u.slice(1);
164
160
  }
165
161
  try {
166
- const filePath = await resolve(prev, u);
162
+ const filePath = await resolve(prev, u, {
163
+ packageConditions: ['sass', 'style'],
164
+ });
167
165
  if (filePath) {
168
166
  const contents = await asset.fs.readFile(filePath, 'utf8');
169
167
  return {filePath, contents};