From 44c80ba6b61574ed839cc0eca2a2f212673b766c Mon Sep 17 00:00:00 2001 From: Alexey Date: Sun, 27 Sep 2020 13:10:05 +0300 Subject: [PATCH] Add `beautify` option warning (#30) * Set `beautify` to false by default * Add warnings to readme --- README.md | 5 ++++- src/loader.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7eb8271..cfd491d 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ When loader emits warning, that means that XML parser failed to parse a file and get dependencies from it. You probably would like to fix file syntax, to have complete experience with webpack rebuild on change. +> :exclamation: Using builtin beautifier could break ES syntax in scripts, that is inlined +> via ``. Consider switching off `beautify` option. + ## Install ```bash npm install --save-dev fest-webpack-loader @@ -49,7 +52,7 @@ module.exports = { |Name|Type|Default|Description| |:--:|:--:|:-----:|:----------| -|**`beautify`**|`{Boolean}`|`true`|Beautify compiled template| +|**`beautify`**|`{Boolean}`|`false`|Beautify compiled template. Built-in `fest` beautifier breaks ES syntax.| |**`trackDependencies`**|`{Boolean}`|`true` for development mode otherwise `false`|Enable template dependencies tracking| |**`module`**|`{String}`|`es`|Compiled template module type. `es` or `cjs`.| diff --git a/src/loader.js b/src/loader.js index c859259..e227de9 100644 --- a/src/loader.js +++ b/src/loader.js @@ -39,7 +39,7 @@ function getModuleWrapper(compiled, moduleType) { * @returns {Promise} */ function compile(source, { - beautify = true, + beautify = false, module = 'es', resourcePath } = {}) {