Skip to content

Commit

Permalink
Add beautify option warning (#30)
Browse files Browse the repository at this point in the history
* Set `beautify` to false by default
* Add warnings to readme
  • Loading branch information
ogonkov committed Sep 27, 2020
1 parent b230d1b commit 44c80ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<fest:script/>`. Consider switching off `beautify` option.
## Install
```bash
npm install --save-dev fest-webpack-loader
Expand Down Expand Up @@ -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`.|

Expand Down
2 changes: 1 addition & 1 deletion src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function getModuleWrapper(compiled, moduleType) {
* @returns {Promise<string, Error>}
*/
function compile(source, {
beautify = true,
beautify = false,
module = 'es',
resourcePath
} = {}) {
Expand Down

0 comments on commit 44c80ba

Please sign in to comment.