1- /* eslint-disable */
21import schema from './options.json' ;
32import { getOptions } from 'loader-utils' ;
43import validateOptions from 'schema-utils' ;
54
65import posthtml from 'posthtml' ;
7- import urls from './plugins/url' ;
8- import imports from './plugins/import' ;
6+ import { urls , imports } from '@posthtml/esm' ;
97import minifier from 'htmlnano' ;
108
119import LoaderError from './Error' ;
1210
1311// Loader Defaults
14- const DEFAULTS = {
12+ const defaults = {
1513 url : true ,
1614 import : true ,
1715 minimize : false ,
@@ -22,7 +20,7 @@ export default function loader(html, map, meta) {
2220 // Loader Options
2321 const options = Object . assign (
2422 { } ,
25- DEFAULTS ,
23+ defaults ,
2624 getOptions ( this )
2725 ) ;
2826
@@ -81,7 +79,7 @@ export default function loader(html, map, meta) {
8179 imports += msg ;
8280 } catch ( err ) {
8381 // TODO(michael-ciniawsky)
84- // revisit
82+ // revisit HTMLImportError
8583 this . emitError ( err )
8684 }
8785
@@ -99,17 +97,16 @@ export default function loader(html, map, meta) {
9997 exports += msg ;
10098 } catch ( err ) {
10199 // TODO(michael-ciniawsky)
102- // revisit
100+ // revisit HTMLExportError
103101 this . emitError ( err )
104102 }
105103
106104 return exports ;
107105 } , '' )
108106
109107 // 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
113110 messages . length = 0 ;
114111
115112 html = options . template
0 commit comments