8000 feat!: turn on modern mode by default, and provide a `--no-module` option by haoqunjiang · Pull Request #6416 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

feat!: turn on modern mode by default, and provide a --no-module option #6416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 14, 2021
Prev Previous commit
Next Next commit
test: add test for --no-module
  • Loading branch information
haoqunjiang committed Apr 13, 2021
commit 5fb28f6dc157b2a1325c0189435731838060b2bb
14 changes: 12 additions & 2 deletions packages/@vue/cli-service/__tests__/modernMode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,18 @@ test('should inject nomodule-fix script when Safari 10 support is required', asy
expect(index).not.toMatch(/[^>]\s*<\/script>/)
})

test.todo('--no-module')
test.todo('--no-modern as an alias to --no-module')
test('--no-module', async () => {
const project = await create('no-module', defaultPreset)

const { stdout } = await project.run('vue-cli-service build --no-module')
expect(stdout).toMatch('Build complete.')

const index = await project.read('dist/index.html')
expect(index).not.toMatch('type="module"')

const files = await fs.readdir(path.join(project.dir, 'dist/js'))
expect(files.some(f => /-legacy.js/.test(f))).toBe(false)
})

afterAll(async () => {
if (browser) {
Expand Down
0