Skip to content

Commit a2a0754

Browse files
committed
feat: export as es6 module
1 parent 5a490fa commit a2a0754

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = function markdownToVueLoader(source, map) {
132132
const $html = cheerio.load($code.text(), cheerioLoadOptions);
133133
const $style = $html('style');
134134

135-
component = $html('script').html() || 'module.exports = {};';
135+
component = $html('script').html() || 'export default {};';
136136
scoped = $style.attr('scoped');
137137
style = $style.html();
138138
template = $html('template').html();
@@ -145,7 +145,7 @@ module.exports = function markdownToVueLoader(source, map) {
145145
const $script = $html('script');
146146
const $style = $html('style');
147147

148-
component = $script.html() || 'module.exports = {};';
148+
component = $script.html() || 'export default {};';
149149
scoped = $style.attr('scoped');
150150
style = $style.html();
151151
$script.remove();
@@ -256,7 +256,7 @@ module.exports = function markdownToVueLoader(source, map) {
256256

257257
if (options.exportSource || components.length > 0) {
258258
$body.append(`<script>
259-
module.exports = {
259+
export default {
260260
${options.exportSource ? `source: ${JSON.stringify(markdown.utils.escapeHtml(source))},` : ''}
261261
${components.length > 0 ? `components: {${components.join()}}` : ''}
262262
};

0 commit comments

Comments
 (0)