• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vuepress / vuepress-next / 7163341834

11 Dec 2023 05:29AM UTC coverage: 67.837% (-1.3%) from 69.176%
7163341834

Pull #1449

github

web-flow
Merge a1378b1ee into b82d48e1e
Pull Request #1449: feat: remove vuepress-vite and vuepress-webpack package and support --bundler option, close #1446

325 of 462 branches covered (0.0%)

Branch coverage included in aggregate %.

2 of 26 new or added lines in 4 files covered. (7.69%)

1 existing line in 1 file now uncovered.

641 of 962 relevant lines covered (66.63%)

47.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

3.57
/packages/cli/src/config/resolveBundler.ts
1
import type { Bundler } from '@vuepress/core'
2
import { colors, logger } from '@vuepress/utils'
3

4
export const resolveBundler = async (
3✔
5
  bundler: 'vite' | 'webpack' | undefined,
6
): Promise<Bundler> => {
NEW
7
  if (bundler === 'vite') {
×
NEW
8
    try {
×
NEW
9
      const { viteBundler } = await import('@vuepress/bundler-vite')
×
10

NEW
11
      return viteBundler()
×
12
    } catch (e) {
NEW
13
      logger.error(
×
14
        `You need to install dependency ${colors.magenta(
15
          '@vuepress/bundler-vite',
16
        )} to use vite bundler.`,
17
      )
18

NEW
19
      throw e
×
20
    }
21
  }
22

NEW
23
  if (bundler === 'webpack') {
×
NEW
24
    try {
×
NEW
25
      const { webpackBundler } = await import('@vuepress/bundler-webpack')
×
26

NEW
27
      return webpackBundler()
×
28
    } catch (e) {
NEW
29
      logger.error(
×
30
        `You need to install dependency ${colors.magenta(
31
          '@vuepress/bundler-webpack',
32
        )} to use webpack bundler.`,
33
      )
34

NEW
35
      throw e
×
36
    }
37
  }
38

NEW
39
  if (bundler) throw new Error(`Unsupported bundler: ${bundler}`)
×
40

NEW
41
  try {
×
NEW
42
    const { viteBundler } = await import('@vuepress/bundler-vite')
×
43

NEW
44
    return viteBundler()
×
45
  } catch (e) {
NEW
46
    try {
×
NEW
47
      const { webpackBundler } = await import('@vuepress/bundler-webpack')
×
48

NEW
49
      return webpackBundler()
×
50
    } catch (e) {
NEW
51
      logger.error(
×
52
        `You need to install a bundler, choose from ${colors.magenta(
53
          '@vuepress/bundler-vite',
54
        )} and ${colors.magenta('@vuepress/bundler-webpack')}.`,
55
      )
56

NEW
57
      throw e
×
58
    }
59
  }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc