sdc-build-wp 4.4.0 → 4.4.1

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.
@@ -53,7 +53,7 @@ export default class ScriptsComponent extends BaseComponent {
53
53
  outdir: `${this.project.paths.dist}/${this.project.paths.src.scripts}/`,
54
54
  entryNames: '[dir]/[name].min',
55
55
  plugins: [],
56
- sourcemap: true
56
+ sourcemap: process.env.NODE_ENV == 'production' ? false : true
57
57
  });
58
58
  if (result.warnings.length > 0) {
59
59
  log('warn', result.warnings);
@@ -116,13 +116,23 @@ export default class StyleComponent extends BaseComponent {
116
116
  throw Error('Linting error');
117
117
  }
118
118
  const compileResult = await sass.compileAsync(entry, {
119
- style: 'compressed'
119
+ style: 'compressed',
120
+ sourceMap: true
120
121
  });
121
122
  const postcssResult = await postcss([
122
123
  autoprefixer(),
123
124
  sortMQ()
124
- ]).process(compileResult.css, { from: undefined });
125
+ ]).process(compileResult.css, {
126
+ from: undefined,
127
+ to: outFile,
128
+ map: {
129
+ inline: false
130
+ }
131
+ });
125
132
  await fs.writeFile(outFile, postcssResult.css);
133
+ if (process.env.NODE_ENV != 'production') {
134
+ await fs.writeFile(`${outFile}.map`, postcssResult.map.toString());
135
+ }
126
136
  thisClass.end({
127
137
  itemLabel: entryLabel
128
138
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"