File tree Expand file tree Collapse file tree 3 files changed +17
-38
lines changed Expand file tree Collapse file tree 3 files changed +17
-38
lines changed Original file line number Diff line number Diff line change @@ -63,44 +63,28 @@ with [jade-html-loader](https://github.com/bline/jade-html-loader)
63
63
64
64
``` javascript
65
65
66
- module .exports = {
67
- module: {
68
- loaders: [
69
- {
70
- test: / \. html$ / ,
71
- loader: ' html!posthtml!jade-html'
72
- }
73
- ]
74
- },
66
+ { test: / \. jade$ / , loader: ' html!posthtml!jade-html' }
67
+ ```
75
68
76
- posthtml : function () {
77
- return {
78
- defaults: [ PostHTML Plugins ]
79
- }
80
- }
81
- }
69
+ with [ handlebars-loader] ( https://github.com/altano/handlebars-loader )
70
+
71
+ ``` javascript
72
+
73
+ { test: / \. hbs$ / , loader: ' handlebars!html!posthtml' }
82
74
```
83
75
84
76
with [ dom-loader] ( https://github.com/Wizcorp/dom-loader )
85
77
86
78
``` javascript
87
79
88
- module .exports = {
89
- module: {
90
- loaders: [
91
- {
92
- test: / \. html$ / ,
93
- loader: ' dom!html!posthtml'
94
- }
95
- ]
96
- },
80
+ { test: / \. html$ / , loader: ' dom!html!posthtml' }
81
+ ```
97
82
98
- posthtml : function () {
99
- return {
100
- defaults: [ PostHTML Plugins ]
101
- }
102
- }
103
- }
83
+ with [ svg-loader] ( https://github.com/Wizcorp/dom-loader )
84
+
85
+ ``` javascript
86
+
87
+ { test: / \. html$ / , loader: ' svg!posthtml' }
104
88
```
105
89
106
90
with [ extract-text-plugin] ( https://github.com/webpack/extract-text-webpack-plugin )
Original file line number Diff line number Diff line change @@ -21,20 +21,15 @@ module.exports = function (source) {
21
21
plugins = plugins [ options . pack ]
22
22
}
23
23
if ( typeof plugins === 'undefined' || typeof plugins === 'object' ) {
24
- plugins = [ ]
24
+ plugins = plugins . defaults || [ ]
25
25
}
26
26
27
27
var loader = this
28
28
var callback = this . async ( )
29
29
30
- console . log ( options )
31
-
32
30
posthtml ( plugins )
33
31
. process ( source . toString ( ) )
34
- . then ( ( result ) => {
35
- console . log ( result . html )
36
- callback ( null , result . html )
37
- } )
32
+ . then ( result => callback ( null , result . html ) )
38
33
. catch ( ( error ) => {
39
34
if ( error . name === 'HTML Syntax Error' ) {
40
35
loader . emitError ( error . message + error . showSourceCode ( ) )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " posthtml-loader" ,
3
- "version" : " 0.0.7 " ,
3
+ "version" : " 0.8.0 " ,
4
4
"engine" : " >=4" ,
5
5
"main" : " index.js" ,
6
6
"dependencies" : {
You can’t perform that action at this time.
0 commit comments