You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to use are shareable config file instead of inline options in your `webpack.config.js` create a `posthtml.config.js` file and place it somewhere down the file tree in your project. The nearest config relative to `dirname(file)` currently processed by the loader applies. This enables **Config Cascading**. Despite some edge cases the config file will be loaded automatically and **no** additional setup is required. If you don't intend to use Config Cascading, it's recommended to place `posthtml.config.js` in the **root**`./` of your project
70
75
71
76
```
@@ -157,6 +162,50 @@ If you want to use a custom parser e.g [SugarML](https://github.com/posthtml/sug
157
162
}
158
163
```
159
164
165
+
### `skipParse`
166
+
167
+
If you want to use disable parsing, you can pass it in under the `skipParse` key in the loader options
168
+
169
+
#### `{Boolean}`
170
+
171
+
**webpack.config.js**
172
+
```js
173
+
{
174
+
loader:'posthtml-loader',
175
+
options: {
176
+
skipParse:false
177
+
}
178
+
}
179
+
```
180
+
181
+
### `Render`
182
+
183
+
If you want to use a custom render, you can pass it in under the `render` key in the loader options
184
+
185
+
#### `{String}`
186
+
187
+
**webpack.config.js**
188
+
```js
189
+
{
190
+
loader:'posthtml-loader',
191
+
options: {
192
+
render:'posthtml-you-render'
193
+
}
194
+
}
195
+
```
196
+
197
+
#### `{Function}`
198
+
199
+
**webpack.config.js**
200
+
```js
201
+
{
202
+
loader:'posthtml-loader',
203
+
options: {
204
+
parser:require('posthtml-you-render')()
205
+
}
206
+
}
207
+
```
208
+
160
209
### `Plugins`
161
210
162
211
Plugins are specified under the `plugins` key in the loader options
@@ -191,6 +240,38 @@ Plugins are specified under the `plugins` key in the loader options
191
240
}
192
241
```
193
242
243
+
### `Sync`
244
+
245
+
Enables sync mode, plugins will run synchronously, throws an error when used with async plugins
246
+
247
+
#### `{Boolean}`
248
+
249
+
**webpack.config.js**
250
+
```js
251
+
{
252
+
loader:'posthtml-loader',
253
+
options: {
254
+
sync:true
255
+
}
256
+
}
257
+
```
258
+
259
+
### `Directives`
260
+
261
+
If you want to use a custom directives, you can pass it in under the `directives` key in the loader options
262
+
263
+
#### `{Array}`
264
+
265
+
**webpack.config.js**
266
+
```js
267
+
{
268
+
loader:'posthtml-loader',
269
+
options: {
270
+
directives: [{name:'?php', start:'<', end:'>'}]
271
+
}
272
+
}
273
+
```
274
+
194
275
<h2align="center">Maintainer</h2>
195
276
196
277
<table>
@@ -202,15 +283,6 @@ Plugins are specified under the `plugins` key in the loader options
0 commit comments