From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/vue/src/server/webpack-plugin/util.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 node_modules/vue/src/server/webpack-plugin/util.js (limited to 'node_modules/vue/src/server/webpack-plugin/util.js') diff --git a/node_modules/vue/src/server/webpack-plugin/util.js b/node_modules/vue/src/server/webpack-plugin/util.js new file mode 100644 index 00000000..d22e4b2c --- /dev/null +++ b/node_modules/vue/src/server/webpack-plugin/util.js @@ -0,0 +1,24 @@ +const { red, yellow } = require('chalk') + +const prefix = `[vue-server-renderer-webpack-plugin]` +const warn = exports.warn = msg => console.error(red(`${prefix} ${msg}\n`)) +const tip = exports.tip = msg => console.log(yellow(`${prefix} ${msg}\n`)) + +export const validate = compiler => { + if (compiler.options.target !== 'node') { + warn('webpack config `target` should be "node".') + } + + if (compiler.options.output && compiler.options.output.libraryTarget !== 'commonjs2') { + warn('webpack config `output.libraryTarget` should be "commonjs2".') + } + + if (!compiler.options.externals) { + tip( + 'It is recommended to externalize dependencies in the server build for ' + + 'better build performance.' + ) + } +} + +export { isJS, isCSS } from '../util' -- cgit v1.2.3