@luzhaoqi/test 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/assets/css/index.css +24 -0
- package/dist/assets/fonts/element-icons.ttf +0 -0
- package/dist/assets/fonts/element-icons.woff +0 -0
- package/dist/lib-cjs.js +166 -0
- package/package.json +47 -0
- package/rollup.config.mjs +75 -0
package/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# project-name
|
2
|
+
|
3
|
+
## Project setup
|
4
|
+
```
|
5
|
+
npm install
|
6
|
+
```
|
7
|
+
|
8
|
+
### Compiles and hot-reloads for development
|
9
|
+
```
|
10
|
+
npm run serve
|
11
|
+
```
|
12
|
+
|
13
|
+
### Compiles and minifies for production
|
14
|
+
```
|
15
|
+
npm run build
|
16
|
+
```
|
17
|
+
|
18
|
+
### Lints and fixes files
|
19
|
+
```
|
20
|
+
npm run lint
|
21
|
+
```
|
22
|
+
|
23
|
+
### Customize configuration
|
24
|
+
See [Configuration Reference](https://cli.vuejs.org/config/).
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: "element-icons";
|
3
|
+
src: url("../fonts/element-icons.woff") format("woff"), url("../fonts/element-icons.ttf") format("truetype");
|
4
|
+
font-weight: normal;
|
5
|
+
font-style: normal;
|
6
|
+
}
|
7
|
+
[class^=k-icon-] {
|
8
|
+
font-family: "element-icons" !important;
|
9
|
+
font-style: normal;
|
10
|
+
font-weight: normal;
|
11
|
+
font-variant: normal;
|
12
|
+
text-transform: none;
|
13
|
+
line-height: 1;
|
14
|
+
vertical-align: baseline;
|
15
|
+
display: inline-block;
|
16
|
+
}
|
17
|
+
|
18
|
+
.k-icon-success:before {
|
19
|
+
content: "\e79c";
|
20
|
+
}
|
21
|
+
|
22
|
+
* {
|
23
|
+
color: red;
|
24
|
+
}
|
Binary file
|
Binary file
|
package/dist/lib-cjs.js
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//
|
8
|
+
//
|
9
|
+
|
10
|
+
var script = {
|
11
|
+
name: 'k-icon',
|
12
|
+
props: {
|
13
|
+
name: String
|
14
|
+
}
|
15
|
+
};
|
16
|
+
|
17
|
+
function getDefaultExportFromCjs (x) {
|
18
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
19
|
+
}
|
20
|
+
|
21
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
22
|
+
/* server only */
|
23
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
24
|
+
if (typeof shadowMode !== 'boolean') {
|
25
|
+
createInjectorSSR = createInjector;
|
26
|
+
createInjector = shadowMode;
|
27
|
+
shadowMode = false;
|
28
|
+
} // Vue.extend constructor export interop.
|
29
|
+
|
30
|
+
|
31
|
+
var options = typeof script === 'function' ? script.options : script; // render functions
|
32
|
+
|
33
|
+
if (template && template.render) {
|
34
|
+
options.render = template.render;
|
35
|
+
options.staticRenderFns = template.staticRenderFns;
|
36
|
+
options._compiled = true; // functional template
|
37
|
+
|
38
|
+
if (isFunctionalTemplate) {
|
39
|
+
options.functional = true;
|
40
|
+
}
|
41
|
+
} // scopedId
|
42
|
+
|
43
|
+
|
44
|
+
if (scopeId) {
|
45
|
+
options._scopeId = scopeId;
|
46
|
+
}
|
47
|
+
|
48
|
+
var hook;
|
49
|
+
|
50
|
+
if (moduleIdentifier) {
|
51
|
+
// server build
|
52
|
+
hook = function hook(context) {
|
53
|
+
// 2.3 injection
|
54
|
+
context = context || // cached call
|
55
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
56
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
57
|
+
// 2.2 with runInNewContext: true
|
58
|
+
|
59
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
60
|
+
context = __VUE_SSR_CONTEXT__;
|
61
|
+
} // inject component styles
|
62
|
+
|
63
|
+
|
64
|
+
if (style) {
|
65
|
+
style.call(this, createInjectorSSR(context));
|
66
|
+
} // register component module identifier for async chunk inference
|
67
|
+
|
68
|
+
|
69
|
+
if (context && context._registeredComponents) {
|
70
|
+
context._registeredComponents.add(moduleIdentifier);
|
71
|
+
}
|
72
|
+
}; // used by ssr in case component is cached and beforeCreate
|
73
|
+
// never gets called
|
74
|
+
|
75
|
+
|
76
|
+
options._ssrRegister = hook;
|
77
|
+
} else if (style) {
|
78
|
+
hook = shadowMode ? function () {
|
79
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
80
|
+
} : function (context) {
|
81
|
+
style.call(this, createInjector(context));
|
82
|
+
};
|
83
|
+
}
|
84
|
+
|
85
|
+
if (hook) {
|
86
|
+
if (options.functional) {
|
87
|
+
// register for functional component in vue file
|
88
|
+
var originalRender = options.render;
|
89
|
+
|
90
|
+
options.render = function renderWithStyleInjection(h, context) {
|
91
|
+
hook.call(context);
|
92
|
+
return originalRender(h, context);
|
93
|
+
};
|
94
|
+
} else {
|
95
|
+
// inject component registration as beforeCreate hook
|
96
|
+
var existing = options.beforeCreate;
|
97
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
return script;
|
102
|
+
}
|
103
|
+
|
104
|
+
var normalizeComponent_1 = normalizeComponent;
|
105
|
+
|
106
|
+
|
107
|
+
var __vue_normalize__ = /*@__PURE__*/getDefaultExportFromCjs(normalizeComponent_1);
|
108
|
+
|
109
|
+
/* script */
|
110
|
+
const __vue_script__ = script;
|
111
|
+
|
112
|
+
/* template */
|
113
|
+
var __vue_render__ = function () {
|
114
|
+
var _vm = this;
|
115
|
+
var _h = _vm.$createElement;
|
116
|
+
var _c = _vm._self._c || _h;
|
117
|
+
return _c("i", { class: "k-icon-" + _vm.name })
|
118
|
+
};
|
119
|
+
var __vue_staticRenderFns__ = [];
|
120
|
+
__vue_render__._withStripped = true;
|
121
|
+
|
122
|
+
/* style */
|
123
|
+
const __vue_inject_styles__ = undefined;
|
124
|
+
/* scoped */
|
125
|
+
const __vue_scope_id__ = undefined;
|
126
|
+
/* module identifier */
|
127
|
+
const __vue_module_identifier__ = undefined;
|
128
|
+
/* functional template */
|
129
|
+
const __vue_is_functional_template__ = false;
|
130
|
+
/* style inject */
|
131
|
+
|
132
|
+
/* style inject SSR */
|
133
|
+
|
134
|
+
/* style inject shadow dom */
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
139
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
140
|
+
__vue_inject_styles__,
|
141
|
+
__vue_script__,
|
142
|
+
__vue_scope_id__,
|
143
|
+
__vue_is_functional_template__,
|
144
|
+
__vue_module_identifier__,
|
145
|
+
false,
|
146
|
+
undefined,
|
147
|
+
undefined,
|
148
|
+
undefined
|
149
|
+
);
|
150
|
+
|
151
|
+
__vue_component__.install = function (Vue) {
|
152
|
+
Vue.component(__vue_component__.name, __vue_component__);
|
153
|
+
};
|
154
|
+
|
155
|
+
const components = [__vue_component__];
|
156
|
+
const install = (Vue, option = {}) => {
|
157
|
+
components.forEach((component) => {
|
158
|
+
Vue.use(component, option);
|
159
|
+
});
|
160
|
+
};
|
161
|
+
var index = {
|
162
|
+
install
|
163
|
+
};
|
164
|
+
|
165
|
+
exports.Icon = __vue_component__;
|
166
|
+
exports.default = index;
|
package/package.json
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
{
|
2
|
+
"name": "@luzhaoqi/test",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"private": false,
|
5
|
+
"main": "dist/lib-cjs.js",
|
6
|
+
"scripts": {
|
7
|
+
"build--rollup": "rollup -c",
|
8
|
+
"pub": "npm publish --access public",
|
9
|
+
"lib--rollup": "npm run build--rollup & npm run pub",
|
10
|
+
"serve": "vue-cli-service serve",
|
11
|
+
"build": "vue-cli-service build",
|
12
|
+
"lint": "vue-cli-service lint"
|
13
|
+
},
|
14
|
+
"dependencies": {
|
15
|
+
"core-js": "^3.8.3",
|
16
|
+
"vue": "^2.6.14",
|
17
|
+
"vue-router": "^3.5.1",
|
18
|
+
"vuex": "^3.6.2"
|
19
|
+
},
|
20
|
+
"devDependencies": {
|
21
|
+
"@babel/core": "^7.12.16",
|
22
|
+
"@babel/eslint-parser": "^7.12.16",
|
23
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
24
|
+
"@rollup/plugin-json": "^6.0.1",
|
25
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
26
|
+
"@rollup/plugin-replace": "^5.0.4",
|
27
|
+
"@rollup/plugin-terser": "^0.4.4",
|
28
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
29
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
30
|
+
"@vue/cli-plugin-router": "~5.0.0",
|
31
|
+
"@vue/cli-plugin-vuex": "~5.0.0",
|
32
|
+
"@vue/cli-service": "~5.0.0",
|
33
|
+
"autoprefixer": "^10.4.16",
|
34
|
+
"eslint": "^7.32.0",
|
35
|
+
"eslint-config-prettier": "^8.3.0",
|
36
|
+
"eslint-plugin-prettier": "^4.0.0",
|
37
|
+
"eslint-plugin-vue": "^8.0.3",
|
38
|
+
"prettier": "^2.4.1",
|
39
|
+
"rollup": "^3.23.0",
|
40
|
+
"rollup-plugin-copy": "^3.5.0",
|
41
|
+
"rollup-plugin-postcss": "^4.0.2",
|
42
|
+
"rollup-plugin-vue": "~5.0.0",
|
43
|
+
"sass": "^1.32.7",
|
44
|
+
"sass-loader": "^12.0.0",
|
45
|
+
"vue-template-compiler": "^2.6.14"
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
// 支持读取json文件
|
2
|
+
import json from "@rollup/plugin-json";
|
3
|
+
// 压缩代码
|
4
|
+
// import terser from "@rollup/plugin-terser";
|
5
|
+
// 支持直接打包 node-modules 里面的内容
|
6
|
+
import resolve from "@rollup/plugin-node-resolve";
|
7
|
+
// 支持commonjs 语法
|
8
|
+
import commonjs from "@rollup/plugin-commonjs";
|
9
|
+
// 更改 rollup 的环境变量
|
10
|
+
import replace from "@rollup/plugin-replace";
|
11
|
+
// rollup-plugin-vue 包含着 scss ,所以我们可以自由使用 scss
|
12
|
+
import vue from "rollup-plugin-vue";
|
13
|
+
// rollup-plugin-copy 主要负责资源的 复制,将静态资源直接复制到 assets 中去
|
14
|
+
import copy from "rollup-plugin-copy";
|
15
|
+
// rollup-plugin-postcss 和 autoprefixer 主要是一些 scss 语法的兼容,不安装打包会报错
|
16
|
+
import postcss from "rollup-plugin-postcss";
|
17
|
+
import autoprefixer from "autoprefixer";
|
18
|
+
|
19
|
+
export default {
|
20
|
+
input: "./lib/index.js",
|
21
|
+
output: [
|
22
|
+
{
|
23
|
+
file: "./dist/lib-umd.js",
|
24
|
+
format: "umd",
|
25
|
+
name: "myLib"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
file: "./dist/lib-es.js",
|
29
|
+
format: "es"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
file: "./dist/lib-cjs.js",
|
33
|
+
format: "cjs"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
file: "./dist/lib-system.js",
|
37
|
+
format: "system"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
file: "./dist/lib-iife.js",
|
41
|
+
format: "iife"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
file: "./dist/lib-amd.js",
|
45
|
+
format: "amd"
|
46
|
+
}
|
47
|
+
],
|
48
|
+
plugins: [
|
49
|
+
commonjs(),
|
50
|
+
resolve(),
|
51
|
+
json(),
|
52
|
+
replace({
|
53
|
+
"process.env.NODE_ENV": JSON.stringify("development"),
|
54
|
+
"process.env.VUE_ENV": JSON.stringify("browser")
|
55
|
+
}),
|
56
|
+
vue(),
|
57
|
+
postcss({
|
58
|
+
plugins: [
|
59
|
+
// 前缀
|
60
|
+
autoprefixer()
|
61
|
+
],
|
62
|
+
// 把 css 拎出来
|
63
|
+
extract: "assets/css/index.css"
|
64
|
+
}),
|
65
|
+
copy({
|
66
|
+
targets: [
|
67
|
+
{
|
68
|
+
src: "./lib/fonts/**",
|
69
|
+
dest: "dist/assets/fonts"
|
70
|
+
}
|
71
|
+
]
|
72
|
+
})
|
73
|
+
// terser()
|
74
|
+
]
|
75
|
+
};
|