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.
- package/lib/components/scripts.js +1 -1
- package/lib/components/style.js +12 -2
- package/package.json +1 -1
@@ -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);
|
package/lib/components/style.js
CHANGED
@@ -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, {
|
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
|
});
|