Skip to content

Commit c5a3c08

Browse files
committed
fix: test for use-cases
1 parent 7a02ef1 commit c5a3c08

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

example/nuxt.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ const meta = [
3333
href: '/humans.txt',
3434
},
3535
]
36-
, script = [
37-
{
38-
once: true,
39-
hid: 'keep-me',
40-
src: '/scripts/keep-me.js',
41-
class: 'nuxt-prune--keep',
42-
async: true,
43-
defer: true,
44-
},
45-
]
36+
, script = []
4637
;
4738

4839
export default {

test/module-headers-override.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ const BASE_URL = '/';
1414

1515
config.dev = false;
1616
config.router.base = BASE_URL;
17+
config.head.script && config.head.script.push(
18+
{
19+
once: true,
20+
hid: 'keep-me',
21+
src: '/scripts/keep-me.js',
22+
class: 'nuxt-prune--keep',
23+
async: true,
24+
defer: true,
25+
},
26+
);
1727

1828
// New features
1929
config.pruneHtml = {

test/module-keep-scripts.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ const BASE_URL = '/';
1414

1515
config.dev = false;
1616
config.router.base = BASE_URL;
17+
config.head.script && config.head.script.push(
18+
{
19+
once: true,
20+
hid: 'keep-me',
21+
src: '/scripts/keep-me.js',
22+
class: 'nuxt-prune--keep',
23+
async: true,
24+
defer: true,
25+
},
26+
);
1727

1828
// New features
1929
config.pruneHtml = {

0 commit comments

Comments
 (0)