diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index bcda274..d8e9a77 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -27,6 +27,8 @@ module.exports = { const cookieParser = require('cookie-parser') app.use(cookieParser()) }, + // Copy URL to system clipboard on start + copyUrlOnStart: true, // Paths distPath: path.resolve(__dirname, './dist'), error500Html: null, diff --git a/lib/config.js b/lib/config.js index db57255..457c32c 100644 --- a/lib/config.js +++ b/lib/config.js @@ -9,6 +9,7 @@ module.exports = { skipRequests: req => req.originalUrl === '/graphql', nodeExternalsWhitelist: [/\.css$/, /\?vue&type=style/], extendServer: null, + copyUrlOnStart: true, // Paths distPath: null, error500Html: null, diff --git a/lib/dev-server.js b/lib/dev-server.js index ce5556a..b8b7bda 100644 --- a/lib/dev-server.js +++ b/lib/dev-server.js @@ -116,12 +116,13 @@ module.exports.setupDevServer = ({ server, templatePath, onUpdate }) => new Prom }) function onCompilationCompleted () { + copied = '' if (firstRun) { firstRun = false - require('clipboardy').write(url) - copied = chalk.dim('(copied to clipboard)') - } else { - copied = '' + if(config.copyUrlOnStart) { + require('clipboardy').write(url) + copied = chalk.dim('(copied to clipboard)') + } } setTimeout(() => {