0.1.4 • Published 4 years ago
zxy-hello-world-test v0.1.4
step1
添加入口文件index.js
import helloworld from "@/components/helloworld";
const HelloWorldSimple = {
install(Vue, options) {
// Let's register our component globally
// https://vuejs.org/v2/guide/components-registration.html
Vue.component("hello-world", helloworld);
},
};
// Automatic installation if Vue has been added to the global scope.
if (typeof window !== "undefined" && window.Vue) {
window.Vue.use(HelloWorldSimple);
}
export default HelloWorldSimple;
Step2
配置package.json
- 配置打包命令
vue-cli-service build --target lib --name myLib [entry]
vue-cli-service main
version
files
Step3
上传npm库
npm login
npm publish
Step4
- 发现css没有内联,怎么办。
module.exports = {
css: { extract: false },
};
Step5
调试
yarn link
yarn link [package]