Skip to content

Commit ec1947c

Browse files
author
Kevin McClellan
committed
Add copyUrlOnStart option for clipboardy
1 parent 0789dc8 commit ec1947c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

docs/guide/configuration.md

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module.exports = {
2727
const cookieParser = require('cookie-parser')
2828
app.use(cookieParser())
2929
},
30+
// Copy URL to system clipboard on start
31+
copyUrlOnStart: true,
3032
// Paths
3133
distPath: path.resolve(__dirname, './dist'),
3234
templatePath: path.resolve(__dirname, './dist/index.html'),

lib/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
skipRequests: req => req.originalUrl === '/graphql',
1111
nodeExternalsWhitelist: [/\.css$/, /\?vue&type=style/],
1212
extendServer: null,
13+
copyUrlOnStart: true,
1314
// Paths
1415
distPath: null,
1516
templatePath: null,

lib/dev-server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ module.exports.setupDevServer = ({ server, templatePath, onUpdate }) => new Prom
118118
function onCompilationCompleted () {
119119
if (firstRun) {
120120
firstRun = false
121-
require('clipboardy').write(url)
122-
copied = chalk.dim('(copied to clipboard)')
123-
} else {
124-
copied = ''
121+
if(config.copyUrlOnStart) {
122+
require('clipboardy').write(url)
123+
copied = chalk.dim('(copied to clipboard)')
124+
}
125125
}
126126

127127
setTimeout(() => {

0 commit comments

Comments
 (0)