1
- /* eslint-disable */
2
1
import schema from './options.json' ;
3
2
import { getOptions } from 'loader-utils' ;
4
3
import validateOptions from 'schema-utils' ;
5
4
6
5
import posthtml from 'posthtml' ;
7
- import urls from './plugins/url' ;
8
- import imports from './plugins/import' ;
6
+ import { urls , imports } from '@posthtml/esm' ;
9
7
import minifier from 'htmlnano' ;
10
8
11
9
import LoaderError from './Error' ;
12
10
13
11
// Loader Defaults
14
- const DEFAULTS = {
12
+ const defaults = {
15
13
url : true ,
16
14
import : true ,
17
15
minimize : false ,
@@ -22,7 +20,7 @@ export default function loader(html, map, meta) {
22
20
// Loader Options
23
21
const options = Object . assign (
24
22
{ } ,
25
- DEFAULTS ,
23
+ defaults ,
26
24
getOptions ( this )
27
25
) ;
28
26
@@ -81,7 +79,7 @@ export default function loader(html, map, meta) {
81
79
imports += msg ;
82
80
} catch ( err ) {
83
81
// TODO(michael-ciniawsky)
84
- // revisit
82
+ // revisit HTMLImportError
85
83
this . emitError ( err )
86
84
}
87
85
@@ -99,17 +97,16 @@ export default function loader(html, map, meta) {
99
97
exports += msg ;
100
98
} catch ( err ) {
101
99
// TODO(michael-ciniawsky)
102
- // revisit
100
+ // revisit HTMLExportError
103
101
this . emitError ( err )
104
102
}
105
103
106
104
return exports ;
107
105
} , '' )
108
106
109
107
// TODO(michael-ciniawsky)
110
- // replace posthtml with @post 5/core
111
- // HACK Ensure to cleanup/reset messages
112
- // during recursive resolving of imports
108
+ // HACK Ensure to cleanup/reset messages between files
109
+ // @see https://github.com/posthtml/posthtml/pull/250
113
110
messages . length = 0 ;
114
111
115
112
html = options . template
0 commit comments