Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 75be640

Browse files
committed
fix: show proper stack traces from uglified code (split by new line instead of semicolon)
1 parent 621090a commit 75be640

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Diff for: templates/webpack.angular.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = env => {
5252
unitTesting, // --env.unitTesting
5353
} = env;
5454

55+
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
5556
const externals = nsWebpack.getConvertedExternals(env.externals);
5657
const appFullPath = resolve(projectRoot, appPath);
5758
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
@@ -93,7 +94,7 @@ module.exports = env => {
9394
mainPath: join(appFullPath, entryModule),
9495
tsConfigPath: join(__dirname, tsConfigName),
9596
skipCodeGeneration: !aot,
96-
sourceMap: !!sourceMap,
97+
sourceMap: !!isAnySourceMapEnabled,
9798
additionalLazyModuleResources: additionalLazyModuleResources
9899
});
99100

@@ -168,10 +169,11 @@ module.exports = env => {
168169
new TerserPlugin({
169170
parallel: true,
170171
cache: true,
171-
sourceMap: !!sourceMap || !!hiddenSourceMap,
172+
sourceMap: isAnySourceMapEnabled,
172173
terserOptions: {
173174
output: {
174175
comments: false,
176+
semicolons: !isAnySourceMapEnabled
175177
},
176178
compress: {
177179
// The Android SBG has problems parsing the output

Diff for: templates/webpack.javascript.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ module.exports = env => {
4545
hmr, // --env.hmr,
4646
unitTesting, // --env.unitTesting
4747
} = env;
48-
const externals = nsWebpack.getConvertedExternals(env.externals);
4948

49+
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
50+
const externals = nsWebpack.getConvertedExternals(env.externals);
5051
const appFullPath = resolve(projectRoot, appPath);
5152
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
5253

@@ -129,10 +130,11 @@ module.exports = env => {
129130
new TerserPlugin({
130131
parallel: true,
131132
cache: true,
132-
sourceMap: !!sourceMap || !!hiddenSourceMap,
133+
sourceMap: isAnySourceMapEnabled,
133134
terserOptions: {
134135
output: {
135136
comments: false,
137+
semicolons: !isAnySourceMapEnabled
136138
},
137139
compress: {
138140
// The Android SBG has problems parsing the output

Diff for: templates/webpack.typescript.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = env => {
4545
hmr, // --env.hmr,
4646
unitTesting, // --env.unitTesting
4747
} = env;
48+
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
4849
const externals = nsWebpack.getConvertedExternals(env.externals);
4950

5051
const appFullPath = resolve(projectRoot, appPath);
@@ -131,10 +132,11 @@ module.exports = env => {
131132
new TerserPlugin({
132133
parallel: true,
133134
cache: true,
134-
sourceMap: !!sourceMap || !!hiddenSourceMap,
135+
sourceMap: isAnySourceMapEnabled,
135136
terserOptions: {
136137
output: {
137138
comments: false,
139+
semicolons: !isAnySourceMapEnabled
138140
},
139141
compress: {
140142
// The Android SBG has problems parsing the output
@@ -207,7 +209,7 @@ module.exports = env => {
207209
configFile: "tsconfig.tns.json",
208210
allowTsInNodeModules: true,
209211
compilerOptions: {
210-
sourceMap
212+
isAnySourceMapEnabled
211213
}
212214
},
213215
}

Diff for: templates/webpack.vue.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = env => {
5050
unitTesting, // --env.unitTesting
5151
} = env;
5252

53+
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
5354
const externals = nsWebpack.getConvertedExternals(env.externals);
5455

5556
const mode = production ? "production" : "development"
@@ -142,10 +143,11 @@ module.exports = env => {
142143
new TerserPlugin({
143144
parallel: true,
144145
cache: true,
145-
sourceMap: !!sourceMap || !!hiddenSourceMap,
146+
sourceMap: isAnySourceMapEnabled,
146147
terserOptions: {
147148
output: {
148149
comments: false,
150+
semicolons: !isAnySourceMapEnabled
149151
},
150152
compress: {
151153
// The Android SBG has problems parsing the output

0 commit comments

Comments
 (0)