Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit 1011408

Browse files
EtienneSchmitzkazupon
authored andcommitted
⚡ improvement(build): improve single-file components bindling (#20) by @EtienneSchmitz
* 🐛 bug(core) : Correct the bug which prevents to use vue files. In build mode, it is impossible to create components plugins because the import of vue files provokes errors. By adding rollup-plugin-vue in the configuration of rollup, we can solve the problem. See #19 * lint(core) : Resolve the problem with linter. Problem with the linter : Extra semicolon semi at 6.
1 parent 1f49b2f commit 1011408

File tree

3 files changed

+104
-12
lines changed

3 files changed

+104
-12
lines changed

lib/build/entry.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const babel = require('rollup-plugin-babel')
33
const cjs = require('rollup-plugin-commonjs')
44
const node = require('rollup-plugin-node-resolve')
55
const replace = require('rollup-plugin-replace')
6+
const VuePlugin = require('rollup-plugin-vue')
67
const typescript = require('rollup-plugin-typescript2')
78
const { classify } = require('../utils')
89

@@ -58,6 +59,9 @@ function buildinPlugins (version, env, langInfo) {
5859
}
5960

6061
if (langInfo.useBabel) {
62+
plugins.push(
63+
VuePlugin()
64+
)
6165
plugins.push(
6266
babel({
6367
// https://cli.vuejs.org/guide/browser-compatibility.html#polyfills-when-building-as-library-or-web-components

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"rollup-plugin-node-resolve": "^4.0.0",
2020
"rollup-plugin-replace": "^2.1.0",
2121
"rollup-plugin-typescript2": "^0.19.2",
22+
"rollup-plugin-vue": "^4.7.2",
2223
"uglify-js": "^2.7.5",
2324
"vuepress": "^1.0.0-alpha.31"
2425
},

yarn.lock

Lines changed: 99 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,21 @@
11131113
validate-npm-package-name "^3.0.0"
11141114
yaml-front-matter "^3.4.1"
11151115

1116+
"@vue/component-compiler-utils@^2.1.0":
1117+
version "2.6.0"
1118+
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.6.0.tgz#aa46d2a6f7647440b0b8932434d22f12371e543b"
1119+
integrity sha512-IHjxt7LsOFYc0DkTncB7OXJL7UzwOLPPQCfEUNyxL2qt+tF12THV+EO33O1G2Uk4feMSWua3iD39Itszx0f0bw==
1120+
dependencies:
1121+
consolidate "^0.15.1"
1122+
hash-sum "^1.0.2"
1123+
lru-cache "^4.1.2"
1124+
merge-source-map "^1.1.0"
1125+
postcss "^7.0.14"
1126+
postcss-selector-parser "^5.0.0"
1127+
prettier "1.16.3"
1128+
source-map "~0.6.1"
1129+
vue-template-es2015-compiler "^1.9.0"
1130+
11161131
"@vue/component-compiler-utils@^2.5.1":
11171132
version "2.5.2"
11181133
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.5.2.tgz#a8d57e773354ab10e4742c7d6a8dd86184d4d7be"
@@ -1128,6 +1143,17 @@
11281143
source-map "~0.6.1"
11291144
vue-template-es2015-compiler "^1.8.2"
11301145

1146+
"@vue/component-compiler@^3.6":
1147+
version "3.6.0"
1148+
resolved "https://registry.yarnpkg.com/@vue/component-compiler/-/component-compiler-3.6.0.tgz#8db313e50eaa2903cef5aac68c37a09364dba79d"
1149+
integrity sha512-NIA0vmOI4zbtJAn69iZls8IJ8VxmguswAuiUdu8TcR+YYTYzntfw290HUCSFjzAdRg+FUWZv8r+wc3TzJ/IjwA==
1150+
dependencies:
1151+
"@vue/component-compiler-utils" "^2.1.0"
1152+
clean-css "^4.1.11"
1153+
hash-sum "^1.0.2"
1154+
postcss-modules-sync "^1.0.0"
1155+
source-map "0.6.*"
1156+
11311157
"@vue/preload-webpack-plugin@^1.1.0":
11321158
version "1.1.0"
11331159
resolved "https://registry.yarnpkg.com/@vue/preload-webpack-plugin/-/preload-webpack-plugin-1.1.0.tgz#d768dba004261c029b53a77c5ea2d5f9ee4f3cce"
@@ -2967,7 +2993,7 @@ class-utils@^0.3.5:
29672993
isobject "^3.0.0"
29682994
static-extend "^0.1.1"
29692995

2970-
clean-css@4.2.x:
2996+
clean-css@4.2.x, clean-css@^4.1.11:
29712997
version "4.2.1"
29722998
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17"
29732999
integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==
@@ -5520,6 +5546,13 @@ generate-object-property@^1.0.0:
55205546
dependencies:
55215547
is-property "^1.0.0"
55225548

5549+
generic-names@^1.0.2:
5550+
version "1.0.3"
5551+
resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-1.0.3.tgz#2d786a121aee508876796939e8e3bff836c20917"
5552+
integrity sha1-LXhqEhruUIh2eWk56OO/+DbCCRc=
5553+
dependencies:
5554+
loader-utils "^0.2.16"
5555+
55235556
get-caller-file@^1.0.1:
55245557
version "1.0.3"
55255558
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
@@ -6245,7 +6278,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
62456278
dependencies:
62466279
safer-buffer ">= 2.1.2 < 3"
62476280

6248-
icss-replace-symbols@^1.1.0:
6281+
icss-replace-symbols@^1.0.2, icss-replace-symbols@^1.1.0:
62496282
version "1.1.0"
62506283
resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded"
62516284
integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=
@@ -7893,6 +7926,13 @@ magic-string@^0.25.1:
78937926
dependencies:
78947927
sourcemap-codec "^1.4.1"
78957928

7929+
magic-string@^0.25.2:
7930+
version "0.25.2"
7931+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9"
7932+
integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==
7933+
dependencies:
7934+
sourcemap-codec "^1.4.4"
7935+
78967936
make-dir@^1.0.0:
78977937
version "1.3.0"
78987938
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
@@ -9538,22 +9578,34 @@ postcss-modules-extract-imports@^1.2.0:
95389578
dependencies:
95399579
postcss "^6.0.1"
95409580

9541-
postcss-modules-local-by-default@^1.2.0:
9581+
postcss-modules-local-by-default@^1.1.1, postcss-modules-local-by-default@^1.2.0:
95429582
version "1.2.0"
95439583
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz#f7d80c398c5a393fa7964466bd19500a7d61c069"
95449584
integrity sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=
95459585
dependencies:
95469586
css-selector-tokenizer "^0.7.0"
95479587
postcss "^6.0.1"
95489588

9549-
postcss-modules-scope@^1.1.0:
9589+
postcss-modules-scope@^1.0.2, postcss-modules-scope@^1.1.0:
95509590
version "1.1.0"
95519591
resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz#d6ea64994c79f97b62a72b426fbe6056a194bb90"
95529592
integrity sha1-1upkmUx5+XtipytCb75gVqGUu5A=
95539593
dependencies:
95549594
css-selector-tokenizer "^0.7.0"
95559595
postcss "^6.0.1"
95569596

9597+
postcss-modules-sync@^1.0.0:
9598+
version "1.0.0"
9599+
resolved "https://registry.yarnpkg.com/postcss-modules-sync/-/postcss-modules-sync-1.0.0.tgz#619a719cf78dd16a4834135140b324cf77334be1"
9600+
integrity sha1-YZpxnPeN0WpINBNRQLMkz3czS+E=
9601+
dependencies:
9602+
generic-names "^1.0.2"
9603+
icss-replace-symbols "^1.0.2"
9604+
postcss "^5.2.5"
9605+
postcss-modules-local-by-default "^1.1.1"
9606+
postcss-modules-scope "^1.0.2"
9607+
string-hash "^1.1.0"
9608+
95579609
postcss-modules-values@^1.3.0:
95589610
version "1.3.0"
95599611
resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz#ecffa9d7e192518389f42ad0e83f72aec456ea20"
@@ -9800,7 +9852,7 @@ postcss-zindex@^2.0.1:
98009852
postcss "^5.0.4"
98019853
uniqs "^2.0.0"
98029854

9803-
postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.16:
9855+
postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.16, postcss@^5.2.5:
98049856
version "5.2.18"
98059857
resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5"
98069858
integrity sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==
@@ -10075,7 +10127,7 @@ querystring-es3@^0.2.0, querystring-es3@^0.2.1:
1007510127
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
1007610128
integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=
1007710129

10078-
querystring@0.2.0:
10130+
querystring@0.2.0, querystring@^0.2.0:
1007910131
version "0.2.0"
1008010132
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
1008110133
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
@@ -10634,6 +10686,21 @@ rollup-plugin-typescript2@^0.19.2:
1063410686
rollup-pluginutils "2.3.3"
1063510687
tslib "1.9.3"
1063610688

10689+
rollup-plugin-vue@^4.7.2:
10690+
version "4.7.2"
10691+
resolved "https://registry.yarnpkg.com/rollup-plugin-vue/-/rollup-plugin-vue-4.7.2.tgz#463a49815def829d4d731e2227f9ffaebb9bb517"
10692+
integrity sha512-RuAK+YTL81/iccOWoadqQz2TXqOogivjbvtCuU6EfVP9/E5XIjuMNVsVWHkSelZQblI1z2b5tshWL7XoiOfABQ==
10693+
dependencies:
10694+
"@vue/component-compiler" "^3.6"
10695+
"@vue/component-compiler-utils" "^2.1.0"
10696+
debug "^4.1.1"
10697+
hash-sum "^1.0.2"
10698+
magic-string "^0.25.2"
10699+
querystring "^0.2.0"
10700+
rollup-pluginutils "^2.0.1"
10701+
source-map "0.7.3"
10702+
vue-runtime-helpers "1.0.0"
10703+
1063710704
rollup-pluginutils@2.3.3, rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.3:
1063810705
version "2.3.3"
1063910706
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
@@ -11081,17 +11148,22 @@ source-map@0.5.6:
1108111148
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
1108211149
integrity sha1-dc449SvwczxafwwRjYEzSiu19BI=
1108311150

11151+
source-map@0.6.*, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
11152+
version "0.6.1"
11153+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
11154+
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
11155+
11156+
source-map@0.7.3:
11157+
version "0.7.3"
11158+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
11159+
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
11160+
1108411161
source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1:
1108511162
version "0.5.7"
1108611163
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
1108711164
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
1108811165

11089-
source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
11090-
version "0.6.1"
11091-
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
11092-
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
11093-
11094-
sourcemap-codec@^1.4.1:
11166+
sourcemap-codec@^1.4.1, sourcemap-codec@^1.4.4:
1109511167
version "1.4.4"
1109611168
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f"
1109711169
integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==
@@ -11294,6 +11366,11 @@ strict-uri-encode@^1.0.0:
1129411366
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
1129511367
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=
1129611368

11369+
string-hash@^1.1.0:
11370+
version "1.1.3"
11371+
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
11372+
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=
11373+
1129711374
string-length@^2.0.0:
1129811375
version "2.0.0"
1129911376
resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
@@ -12301,6 +12378,11 @@ vue-router@^3.0.2:
1230112378
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.2.tgz#dedc67afe6c4e2bc25682c8b1c2a8c0d7c7e56be"
1230212379
integrity sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==
1230312380

12381+
vue-runtime-helpers@1.0.0:
12382+
version "1.0.0"
12383+
resolved "https://registry.yarnpkg.com/vue-runtime-helpers/-/vue-runtime-helpers-1.0.0.tgz#af5fe1c8d727beb680b2eb9d791c8e022342e54d"
12384+
integrity sha512-DgwCNgIXkq1GJsWwtFOjA/K2nxpjyon/QqAut0EiwrMHBatAPbfdqksDdRoK15b5YrSJRa59rx3pc0L6V4udUA==
12385+
1230412386
vue-server-renderer@^2.5.16:
1230512387
version "2.5.22"
1230612388
resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.5.22.tgz#f119efef289c865adc22fda0ae7595299bedbdcf"
@@ -12336,6 +12418,11 @@ vue-template-es2015-compiler@^1.8.2:
1233612418
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.8.2.tgz#dd73e80ba58bb65dd7a8aa2aeef6089cf6116f2a"
1233712419
integrity sha512-cliV19VHLJqFUYbz/XeWXe5CO6guzwd0yrrqqp0bmjlMP3ZZULY7fu8RTC4+3lmHwo6ESVDHFDsvjB15hcR5IA==
1233812420

12421+
vue-template-es2015-compiler@^1.9.0:
12422+
version "1.9.1"
12423+
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
12424+
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
12425+
1233912426
vue@^2.5.16:
1234012427
version "2.5.22"
1234112428
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.22.tgz#3bf88041af08b8539c37b268b70ca79245e9cc30"

0 commit comments

Comments
 (0)