@sprucelabs/heartwood-view-controllers 117.0.6 → 117.1.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.
|
@@ -26,7 +26,7 @@ export default class ViewControllerExporter {
|
|
|
26
26
|
export(options) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
this.assertValidExportOptions(options);
|
|
29
|
-
const { source, destination, profilerStatsDestination, defines, shouldWatch, onDidIncrementallyBuild, onWillIncrementallyBuild, } = options;
|
|
29
|
+
const { source, destination, profilerStatsDestination, defines, shouldWatch, onDidIncrementallyBuild, onWillIncrementallyBuild, shouldBuildSourceMaps, } = options;
|
|
30
30
|
this.assertValidSource(source);
|
|
31
31
|
const { filename, dirname } = this.splitToFileAndDir(destination);
|
|
32
32
|
this.assertValidDestinationFilename(filename);
|
|
@@ -35,6 +35,7 @@ export default class ViewControllerExporter {
|
|
|
35
35
|
destinationDirname: dirname,
|
|
36
36
|
destinationFilename: filename,
|
|
37
37
|
shouldProfile: !!profilerStatsDestination,
|
|
38
|
+
shouldBuildSourceMaps,
|
|
38
39
|
defines,
|
|
39
40
|
});
|
|
40
41
|
this.compiler = this.Compiler();
|
|
@@ -130,11 +131,13 @@ export default class ViewControllerExporter {
|
|
|
130
131
|
return webpack(this.config);
|
|
131
132
|
}
|
|
132
133
|
buildConfiguration(options) {
|
|
133
|
-
const { entry, destinationDirname, destinationFilename, shouldProfile, defines, } = options;
|
|
134
|
+
const { entry, destinationDirname, destinationFilename, shouldProfile, defines, shouldBuildSourceMaps, } = options;
|
|
134
135
|
return {
|
|
135
136
|
entry,
|
|
137
|
+
mode: shouldBuildSourceMaps ? 'development' : 'production',
|
|
136
138
|
context: this.cwd,
|
|
137
139
|
stats: !!shouldProfile,
|
|
140
|
+
devtool: shouldBuildSourceMaps ? 'inline-source-map' : false,
|
|
138
141
|
resolve: {
|
|
139
142
|
extensions: ['.ts', '.js'],
|
|
140
143
|
fallback: {
|
|
@@ -184,7 +187,9 @@ export default class ViewControllerExporter {
|
|
|
184
187
|
loader: `babel-loader`,
|
|
185
188
|
options: {
|
|
186
189
|
configFile: false,
|
|
187
|
-
sourceMaps:
|
|
190
|
+
sourceMaps: shouldBuildSourceMaps
|
|
191
|
+
? 'inline'
|
|
192
|
+
: false,
|
|
188
193
|
presets: [
|
|
189
194
|
[
|
|
190
195
|
'@babel/preset-env',
|
|
@@ -214,7 +219,7 @@ export default class ViewControllerExporter {
|
|
|
214
219
|
],
|
|
215
220
|
},
|
|
216
221
|
optimization: {
|
|
217
|
-
minimize:
|
|
222
|
+
minimize: !shouldBuildSourceMaps,
|
|
218
223
|
minimizer: [new TerserPlugin()],
|
|
219
224
|
},
|
|
220
225
|
plugins: [
|
|
@@ -21,7 +21,7 @@ class ViewControllerExporter {
|
|
|
21
21
|
}
|
|
22
22
|
async export(options) {
|
|
23
23
|
this.assertValidExportOptions(options);
|
|
24
|
-
const { source, destination, profilerStatsDestination, defines, shouldWatch, onDidIncrementallyBuild, onWillIncrementallyBuild, } = options;
|
|
24
|
+
const { source, destination, profilerStatsDestination, defines, shouldWatch, onDidIncrementallyBuild, onWillIncrementallyBuild, shouldBuildSourceMaps, } = options;
|
|
25
25
|
this.assertValidSource(source);
|
|
26
26
|
const { filename, dirname } = this.splitToFileAndDir(destination);
|
|
27
27
|
this.assertValidDestinationFilename(filename);
|
|
@@ -30,6 +30,7 @@ class ViewControllerExporter {
|
|
|
30
30
|
destinationDirname: dirname,
|
|
31
31
|
destinationFilename: filename,
|
|
32
32
|
shouldProfile: !!profilerStatsDestination,
|
|
33
|
+
shouldBuildSourceMaps,
|
|
33
34
|
defines,
|
|
34
35
|
});
|
|
35
36
|
this.compiler = this.Compiler();
|
|
@@ -117,11 +118,13 @@ class ViewControllerExporter {
|
|
|
117
118
|
return (0, webpack_1.webpack)(this.config);
|
|
118
119
|
}
|
|
119
120
|
buildConfiguration(options) {
|
|
120
|
-
const { entry, destinationDirname, destinationFilename, shouldProfile, defines, } = options;
|
|
121
|
+
const { entry, destinationDirname, destinationFilename, shouldProfile, defines, shouldBuildSourceMaps, } = options;
|
|
121
122
|
return {
|
|
122
123
|
entry,
|
|
124
|
+
mode: shouldBuildSourceMaps ? 'development' : 'production',
|
|
123
125
|
context: this.cwd,
|
|
124
126
|
stats: !!shouldProfile,
|
|
127
|
+
devtool: shouldBuildSourceMaps ? 'inline-source-map' : false,
|
|
125
128
|
resolve: {
|
|
126
129
|
extensions: ['.ts', '.js'],
|
|
127
130
|
fallback: {
|
|
@@ -171,7 +174,9 @@ class ViewControllerExporter {
|
|
|
171
174
|
loader: `babel-loader`,
|
|
172
175
|
options: {
|
|
173
176
|
configFile: false,
|
|
174
|
-
sourceMaps:
|
|
177
|
+
sourceMaps: shouldBuildSourceMaps
|
|
178
|
+
? 'inline'
|
|
179
|
+
: false,
|
|
175
180
|
presets: [
|
|
176
181
|
[
|
|
177
182
|
'@babel/preset-env',
|
|
@@ -201,7 +206,7 @@ class ViewControllerExporter {
|
|
|
201
206
|
],
|
|
202
207
|
},
|
|
203
208
|
optimization: {
|
|
204
|
-
minimize:
|
|
209
|
+
minimize: !shouldBuildSourceMaps,
|
|
205
210
|
minimizer: [new terser_webpack_plugin_1.default()],
|
|
206
211
|
},
|
|
207
212
|
plugins: [
|
package/package.json
CHANGED