Skip to content

Commit

Permalink
feat: new option "preserveWhitespace"
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 4, 2018
1 parent f5c0f58 commit ea83441
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
19 changes: 10 additions & 9 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

This comment has been minimized.

Copy link
@janimo

janimo May 13, 2018

preserveWhitepsace is misspelled


// 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,

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = (api, options) => {
.loader('vue-loader')
.options({
compilerOpitons: {

This comment has been minimized.

Copy link
@janimo

janimo May 13, 2018

compilerOpitons is misspelled

preserveWhitespace: false
preserveWhitespace: options.preserveWhitespace
}
})

Expand Down
4 changes: 4 additions & 0 deletions packages/@vue/cli-service/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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,

Expand Down

0 comments on commit ea83441

Please sign in to comment.