Skip to content

Commit d203fa0

Browse files
author
Guillaume Chau
committed
chore: merge dev
2 parents 53280dd + 5793b91 commit d203fa0

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

docs/cli-service.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Options:
104104
--dest specify output directory (default: dist)
105105
--target app | lib | wc | wc-async (default: app)
106106
--name name for lib or web-component mode (default: "name" in package.json or entry filename)
107+
--watch watch for changes
107108
```
108109

109110
`vue-cli-service build` produces a production-ready bundle in the `dist/` directory, with minification for JS/CSS/HTML and auto vendor chunk splitting for better caching. The chunk manifest is inlined into the HTML.

packages/@vue/cli-plugin-e2e-cypress/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Cypress offers a rich interactive interface for running E2E tests, but currently
3131

3232
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
3333

34+
## Environment Variables
35+
36+
Cypress doesn't load .env files for your test files the same way as `vue-cli` does for your [application code](https://github.com/vuejs/vue-cli/blob/dev/docs/env.md#using-env-variables-in-client-side-code). Cypress supports a few ways to [define env variables](https://docs.cypress.io/guides/guides/environment-variables.html#) but the easiest one is to use .json files (either `cypress.json` or `cypress.env.json`) to define environment variables. Keep in mind those variables are accessible via `Cypress.env` function instead of regular `process.env` object.
37+
3438
## Installing in an Already Created Project
3539

3640
``` sh

packages/@vue/cli-plugin-typescript/generator/template/tslint.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"tslint:recommended"
66
],
77
"linterOptions": {
8-
"exclude": [
9-
"node_modules/**"
10-
]
8+
"exclude": [
9+
"node_modules/**"
10+
]
1111
},
1212
"rules": {
1313
"quotemark": [true, "single"],

packages/@vue/cli-service/lib/commands/build/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports = (api, options) => {
1717
'--mode': `specify env mode (default: production)`,
1818
'--dest': `specify output directory (default: ${options.outputDir})`,
1919
'--target': `app | lib | wc | wc-async (default: ${defaults.target})`,
20-
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`
20+
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`,
21+
'--watch': `watch for changes`
2122
}
2223
}, async function build (args) {
2324
args.entry = args.entry || args._[0]
@@ -100,8 +101,12 @@ module.exports = (api, options) => {
100101
: webpackConfig
101102
).output.path
102103

104+
if (args.watch) {
105+
webpackConfig.watch = true
106+
}
107+
103108
if (!args.dest && actualTargetDir !== api.resolve(options.outputDir)) {
104-
// user directly modifys output.path in configureWebpack or chainWebpack.
109+
// user directly modifies output.path in configureWebpack or chainWebpack.
105110
// this is not supported because there's no way for us to give copy
106111
// plugin the correct value this way.
107112
console.error(chalk.red(
@@ -148,7 +153,11 @@ module.exports = (api, options) => {
148153
)
149154
log(formatStats(stats, targetDirShort, api))
150155
if (args.target === 'app') {
151-
done(`Build complete. The ${chalk.cyan(targetDirShort)} directory is ready to be deployed.\n`)
156+
if (!args.watch) {
157+
done(`Build complete. The ${chalk.cyan(targetDirShort)} directory is ready to be deployed.\n`)
158+
} else {
159+
done(`Build complete. Watching for changes...`)
160+
}
152161
if (
153162
options.baseUrl === '/' &&
154163
// only log the tips if this is the first build

0 commit comments

Comments
 (0)