mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-23 04:58:56 -05:00
feat: new option "preserveWhitespace"
This commit is contained in:
+10
-9
@@ -29,15 +29,16 @@ module.exports = {
|
||||
// explicitly transpile a dependency with this option.
|
||||
transpileDependencies: [/* string or regex */],
|
||||
|
||||
// whether to preserve whitespaces between elements during template
|
||||
// compilation. Defaults to false for smaller compiled code size and
|
||||
// performance.
|
||||
preserveWhitepsace: false,
|
||||
|
||||
// tweak internal webpack configuration.
|
||||
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
|
||||
chainWebpack: () => {},
|
||||
configureWebpack: () => {},
|
||||
|
||||
// vue-loader options
|
||||
// https://vue-loader.vuejs.org/en/options.html
|
||||
vueLoader: {},
|
||||
|
||||
// generate sourceMap for production build?
|
||||
productionSourceMap: true,
|
||||
|
||||
@@ -47,16 +48,16 @@ module.exports = {
|
||||
// can also be an object of options to pass to extract-text-webpack-plugin
|
||||
extract: true,
|
||||
|
||||
// Enable CSS modules for all css / pre-processor files.
|
||||
// This option does not affect *.vue files.
|
||||
modules: false,
|
||||
|
||||
// enable CSS source maps?
|
||||
sourceMap: false,
|
||||
|
||||
// pass custom options to pre-processor loaders. e.g. to pass options to
|
||||
// sass-loader, use { sass: { ... } }
|
||||
loaderOptions: {},
|
||||
|
||||
// Enable CSS modules for all css / pre-processor files.
|
||||
// This option does not affect *.vue files.
|
||||
modules: false
|
||||
loaderOptions: {}
|
||||
},
|
||||
|
||||
// use thread-loader for babel & TS in production build
|
||||
|
||||
@@ -48,7 +48,7 @@ module.exports = (api, options) => {
|
||||
.loader('vue-loader')
|
||||
.options({
|
||||
compilerOpitons: {
|
||||
preserveWhitespace: false
|
||||
preserveWhitespace: options.preserveWhitespace
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ const schema = createSchema(joi => joi.object({
|
||||
outputDir: joi.string(),
|
||||
compiler: joi.boolean(),
|
||||
transpileDependencies: joi.array(),
|
||||
preserveWhitespace: joi.boolean(),
|
||||
productionSourceMap: joi.boolean(),
|
||||
parallel: joi.boolean(),
|
||||
devServer: joi.object(),
|
||||
@@ -58,6 +59,9 @@ exports.defaults = () => ({
|
||||
// deps to transpile
|
||||
transpileDependencies: [/* string or regex */],
|
||||
|
||||
// whether to preserve whitespaces between elements
|
||||
preserveWhitespace: false,
|
||||
|
||||
// sourceMap for production build?
|
||||
productionSourceMap: true,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user