Skip to content

Commit dfda95b

Browse files
authored
chore: enable sourcemaps in production (#1487)
1 parent b69ca53 commit dfda95b

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

nuxt.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default defineNuxtConfig({
139139
},
140140
},
141141

142-
sourcemap: false,
142+
sourcemap: { client: true, server: false },
143143

144144
future: {
145145
compatibilityVersion: 4,

test/unit/behaviour.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createPage, setup, url } from '@nuxt/test-utils/e2e'
77
await setup({
88
rootDir: fileURLToPath(new URL('../..', import.meta.url)),
99
nuxtConfig: {
10+
sourcemap: false,
1011
nitro: {
1112
prerender: {
1213
crawlLinks: false,

test/unit/bundle.spec.ts

+31-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('project sizes', () => {
3636
stats.client = await analyzeSizes('**/*.js', publicDir)
3737
expect
3838
.soft(roundToKilobytes(stats.client.totalBytes))
39-
.toMatchInlineSnapshot(`"269k"`)
39+
.toMatchInlineSnapshot(`"270k"`)
4040
expect.soft(stats.client.files.map(f => f.replace(/\..*\.js/, '.js').replace(/_scripts\/.*\.js/, '_scripts/script.js')).sort())
4141
.toMatchInlineSnapshot(`
4242
[
@@ -80,12 +80,12 @@ describe('project sizes', () => {
8080
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
8181
expect
8282
.soft(roundToKilobytes(stats.server.totalBytes))
83-
.toMatchInlineSnapshot(`"430k"`)
83+
.toMatchInlineSnapshot(`"441k"`)
8484

8585
const modules = await analyzeSizes('node_modules/**/*', serverDir)
8686
expect
8787
.soft(roundToKilobytes(modules.totalBytes))
88-
.toMatchInlineSnapshot(`"7489k"`)
88+
.toMatchInlineSnapshot(`"8137k"`)
8989

9090
const packages = modules.files
9191
.filter(m => m.endsWith('package.json'))
@@ -99,6 +99,8 @@ describe('project sizes', () => {
9999
"@atproto/syntax",
100100
"@atproto/xrpc",
101101
"@babel/parser",
102+
"@sanity/client",
103+
"@sanity/eventsource",
102104
"@shikijs/core",
103105
"@shikijs/engine-javascript",
104106
"@shikijs/engine-oniguruma",
@@ -125,8 +127,11 @@ describe('project sizes', () => {
125127
"character-entities-legacy",
126128
"character-reference-invalid",
127129
"comma-separated-tokens",
130+
"core-util-is",
128131
"cssfilter",
132+
"debug",
129133
"decode-named-character-reference",
134+
"decompress-response",
130135
"detab",
131136
"devalue",
132137
"devlop",
@@ -138,9 +143,12 @@ describe('project sizes', () => {
138143
"estree-walker",
139144
"events-to-async",
140145
"events-to-async/module",
146+
"eventsource",
141147
"extend",
142148
"feed",
143149
"flat",
150+
"follow-redirects",
151+
"get-it",
144152
"github-slugger",
145153
"graphemer",
146154
"hast-util-from-parse5",
@@ -155,12 +163,15 @@ describe('project sizes', () => {
155163
"hookable",
156164
"html-void-elements",
157165
"image-meta",
166+
"inherits",
158167
"is-absolute-url",
159168
"is-alphabetical",
160169
"is-alphanumerical",
161170
"is-decimal",
162171
"is-hexadecimal",
163172
"is-plain-obj",
173+
"is-retry-allowed",
174+
"isarray",
164175
"iso-datestring-validator",
165176
"js-yaml",
166177
"longest-streak",
@@ -205,12 +216,18 @@ describe('project sizes', () => {
205216
"micromark-util-resolve-all",
206217
"micromark-util-sanitize-uri",
207218
"micromark-util-subtokenize",
219+
"mimic-response",
220+
"ms",
208221
"multiformats",
209222
"node-emoji",
210223
"oniguruma-to-es",
211224
"parse-entities",
212225
"parse5",
226+
"process-nextick-args",
227+
"progress-stream",
213228
"property-information",
229+
"readable-stream",
230+
"readable-stream/node_modules/safe-buffer",
214231
"rehype-external-links",
215232
"rehype-raw",
216233
"rehype-sort-attribute-values",
@@ -220,17 +237,26 @@ describe('project sizes', () => {
220237
"remark-mdc",
221238
"remark-parse",
222239
"remark-rehype",
240+
"rxjs",
241+
"safe-buffer",
223242
"sax",
224243
"scule",
225244
"shiki",
226245
"skin-tone",
227246
"source-map-js",
228247
"space-separated-tokens",
248+
"speedometer",
249+
"string_decoder",
250+
"string_decoder/node_modules/safe-buffer",
229251
"stringify-entities",
252+
"supports-color",
253+
"through2",
230254
"tlds",
231255
"trim-lines",
232256
"trough",
233257
"ts-custom-error",
258+
"tunnel-agent",
259+
"tunnel-agent/node_modules/safe-buffer",
234260
"uint8arrays",
235261
"unhead",
236262
"unicode-emoji-modifier-base",
@@ -240,13 +266,15 @@ describe('project sizes', () => {
240266
"unist-util-stringify-position",
241267
"unist-util-visit",
242268
"unist-util-visit-parents",
269+
"util-deprecate",
243270
"vfile",
244271
"vfile-location",
245272
"vfile-message",
246273
"vue",
247274
"web-namespaces",
248275
"xml-js",
249276
"xss",
277+
"xtend",
250278
"zod",
251279
"zwitch",
252280
]

0 commit comments

Comments
 (0)