Skip to content

Commit 26710c4

Browse files
committed
build: release 2.1.0
1 parent 4893b77 commit 26710c4

File tree

8 files changed

+6832
-5673
lines changed

8 files changed

+6832
-5673
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.1.0 (Jan 1, 2021)
4+
5+
- Support Vue 3.
6+
- Upgrade to [postcss](https://github.com/postcss/postcss) 8.
7+
- Upgrade to [markdown-it](https://github.com/markdown-it/markdown-it) 12.
8+
39
## 2.0.0 (Oct 19, 2019)
410

511
- Release as a stable version.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
## Features
1111

12+
- Supports Vue 2 and Vue 3.
1213
- Supports to load a markdown file as a Vue component.
1314
- Supports to load code blocks (Vue and HTML by default) as Vue components.
1415
- Supports 10 [options](#options).
@@ -30,7 +31,6 @@ module: {
3031
rules: [
3132
{
3233
test: /\.md$/,
33-
exclude: /(node_modules|bower_components)/,
3434
use: [
3535
'vue-loader',
3636
{

docs/index.html

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1 @@
1-
<!DOCTYPE html>
2-
<html lang="zh-CN">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<meta http-equiv="markdown-to-vue-loader-ua-compatible" content="ie=edge">
7-
<title>markdown-to-vue-loader</title>
8-
<meta name="description" content="Markdown to Vue component loader for Webpack.">
9-
<meta name="author" content="Chen Fengyuan">
10-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
11-
<link rel="stylesheet" href="https://unpkg.com/[email protected]/github-markdown.css" crossorigin="anonymous">
12-
<link rel="stylesheet" href="https://unpkg.com/[email protected]/styles/github.css" crossorigin="anonymous">
13-
</head>
14-
<body>
15-
<div id="app"></div>
16-
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" crossorigin="anonymous"></script>
17-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
18-
<script src="https://unpkg.com/[email protected]/highlight.pack.js" crossorigin="anonymous"></script>
19-
<script src="https://fengyuanchen.github.io/shared/google-analytics.js" crossorigin="anonymous"></script>
20-
<script>hljs.initHighlightingOnLoad();</script>
21-
<script type="text/javascript" src="main.js"></script></body>
22-
</html>
1+
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta http-equiv="markdown-to-vue-loader-ua-compatible" content="ie=edge"><title>markdown-to-vue-loader</title><meta name="description" content="Markdown to Vue component loader for Webpack."><meta name="author" content="Chen Fengyuan"><link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous"><link rel="stylesheet" href="https://unpkg.com/[email protected]/github-markdown.css" crossorigin="anonymous"><link rel="stylesheet" href="https://unpkg.com/[email protected]/styles/github.css" crossorigin="anonymous"></head><body><div id="app"></div><script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" crossorigin="anonymous"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script><script src="https://unpkg.com/[email protected]/highlight.pack.js" crossorigin="anonymous"></script><script src="https://fengyuanchen.github.io/shared/google-analytics.js" crossorigin="anonymous"></script><script>hljs.initHighlightingOnLoad();</script><script src="main.js"></script></body></html>

docs/main.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ function normalizeComponent(script, mixin) {
7474
component = {};
7575
}
7676
77+
if (${isVue3}) {
78+
return Object.assign(component, ${mixin});
79+
}
80+
7781
component.mixins = (component.mixins || []).concat([${mixin}]);
7882
7983
return component;
@@ -134,10 +138,10 @@ module.exports = function markdownToVueLoader(source, map) {
134138
}
135139

136140
const mixin = [];
141+
let template = '';
137142
let component;
138143
let scoped;
139144
let style;
140-
let template;
141145

142146
switch (language) {
143147
case 'vue': {

package-lock.json

Lines changed: 6774 additions & 5604 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markdown-to-vue-loader",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "Markdown to Vue component loader for Webpack.",
55
"main": "index.js",
66
"files": [
@@ -17,7 +17,7 @@
1717
"release": "npm run lint && npm test && npm run release:docs",
1818
"release:docs": "npm run clear:docs && npm run build:docs",
1919
"start": "npm run dev",
20-
"test": "nyc mocha",
20+
"test": "nyc mocha --timeout 10000",
2121
"test:cover": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
2222
},
2323
"repository": {
@@ -43,53 +43,53 @@
4343
},
4444
"homepage": "https://fengyuanchen.github.io/markdown-to-vue-loader",
4545
"dependencies": {
46-
"cheerio": "^1.0.0-rc.2",
47-
"loader-utils": "^1.2.3",
48-
"markdown-it": "^10.0.0",
49-
"postcss": "^7.0.18"
46+
"cheerio": "1.0.0-rc.3",
47+
"loader-utils": "^2.0.0",
48+
"markdown-it": "^12.0.4",
49+
"postcss": "^8.2.2"
5050
},
5151
"peerDependencies": {
52-
"vue-loader": "^15.0.0",
52+
"vue-loader": ">=15.0.0",
5353
"webpack": "^4.0.0"
5454
},
5555
"devDependencies": {
56-
"@babel/core": "^7.6.4",
57-
"@babel/preset-env": "^7.6.3",
58-
"@commitlint/cli": "^8.2.0",
59-
"@commitlint/config-conventional": "^8.2.0",
60-
"babel-loader": "^8.0.6",
56+
"@babel/core": "^7.12.10",
57+
"@babel/preset-env": "^7.12.11",
58+
"@commitlint/cli": "^11.0.0",
59+
"@commitlint/config-conventional": "^11.0.0",
60+
"babel-loader": "^8.2.2",
6161
"chai": "^4.2.0",
62-
"codecov": "^3.6.1",
63-
"cross-env": "^6.0.3",
64-
"css-loader": "^3.2.0",
65-
"del-cli": "^3.0.0",
62+
"codecov": "^3.8.1",
63+
"cross-env": "^7.0.3",
64+
"css-loader": "^5.0.1",
65+
"del-cli": "^3.0.1",
6666
"eslint": "^6.5.1",
67-
"eslint-config-airbnb-base": "^14.0.0",
68-
"eslint-plugin-html": "^6.0.0",
69-
"eslint-plugin-import": "^2.18.2",
70-
"eslint-plugin-vue": "^5.2.3",
71-
"html-webpack-plugin": "^3.2.0",
72-
"husky": "^3.0.9",
73-
"lint-staged": "^9.4.2",
67+
"eslint-config-airbnb-base": "^14.2.1",
68+
"eslint-plugin-html": "^6.1.1",
69+
"eslint-plugin-import": "^2.22.1",
70+
"eslint-plugin-vue": "^v6.2.2",
71+
"html-webpack-plugin": "^4.5.0",
72+
"husky": "^4.3.6",
73+
"lint-staged": "^10.5.3",
7474
"memory-fs": "^0.5.0",
75-
"mocha": "^6.2.2",
76-
"nyc": "^14.1.1",
77-
"postcss-cli": "^6.1.3",
78-
"postcss-import": "^12.0.1",
79-
"postcss-loader": "^3.0.0",
75+
"mocha": "^8.2.1",
76+
"nyc": "^15.1.0",
77+
"postcss-cli": "^8.3.1",
78+
"postcss-import": "^14.0.0",
79+
"postcss-loader": "^4.1.0",
8080
"postcss-preset-env": "^6.7.0",
81-
"style-loader": "^1.0.0",
82-
"stylelint": "^11.1.1",
83-
"stylelint-config-standard": "^19.0.0",
84-
"stylelint-order": "^3.1.1",
85-
"vue": "^2.6.10",
86-
"vue-loader": "^15.7.0",
81+
"style-loader": "^2.0.0",
82+
"stylelint": "^13.8.0",
83+
"stylelint-config-standard": "^20.0.0",
84+
"stylelint-order": "^4.1.0",
85+
"vue": "^2.6.12",
86+
"vue-loader": "^15.9.6",
8787
"vue-style-loader": "^4.1.2",
88-
"vue-template-compiler": "^2.6.10",
89-
"webpack": "^4.41.2",
90-
"webpack-cli": "^3.3.9",
91-
"webpack-dev-server": "^3.8.2",
92-
"webpack-merge": "^4.2.2"
88+
"vue-template-compiler": "^2.6.12",
89+
"webpack": "^4.44.2",
90+
"webpack-cli": "^3.3.12",
91+
"webpack-dev-server": "^3.11.1",
92+
"webpack-merge": "^5.7.3"
9393
},
9494
"browserslist": [
9595
"last 2 versions",

test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const path = require('path');
22
const webpack = require('webpack');
3-
const webpackMerge = require('webpack-merge');
3+
const { merge } = require('webpack-merge');
44
const VueLoaderPlugin = require('vue-loader/lib/plugin');
55
const MemoryFS = require('memory-fs');
66
const { expect } = require('chai');
77

88
const mfs = new MemoryFS();
99

1010
function bundle(options, callback, loaderOptions = {}) {
11-
const config = webpackMerge({
11+
const config = merge({
1212
mode: 'none',
1313
output: {
1414
path: path.resolve(__dirname, './expected'),

0 commit comments

Comments
 (0)