我想dist在使用 vue-cli 构建我自己的库时添加一个文件夹,其中包含一些 JSON 文件。
我运行以下命令来构建库:
vue-cli-service build --target lib src/index.js。
我尝试在public文件夹中添加文件夹,但在构建库时不起作用。
有办法实现吗?
谢谢
vuetify 文档仅提供了使用https://vuetifyjs.com/en/customization/sass-variables#markup-js-vue-config-sass-variables 中的vue-cli 配置注入 sass 变量的示例vue.config.js
不使用 CLI 时提供修改后的 vuetify 变量的正确方法是什么?
我正在将一个旧项目从 v1(手写笔)升级到 v2(sass),我需要覆盖一些变量,假设我只需要将字体系列更改为 Arial。
我也在 vuetify 中使用 treeshaking。
现在我有点卡住了,因为我不知道在哪里导入样式覆盖......src/main.ts显然导入这些是行不通的。
我在这里创建了一个最小的复制:https : //github.com/Sharsie/vuetify-theme-repro/
到目前为止,我所拥有的是build目录中的 webpack 配置和样式覆盖src/styles/main.scss
$body-font-family: Arial;
@import "~vuetify/src/styles/styles.sass";
Run Code Online (Sandbox Code Playgroud)
运行项目创建一个简单的页面,打印出v-app容器的计算样式
<v-app id="app">
<v-container>
<v-content>
<p>Wanted font-family: Arial</p>
<p>Current font-family: {{ fontFamily }}</p>
</v-content>
</v-container>
</v-app>
Run Code Online (Sandbox Code Playgroud) 需要使用 Vue CLI 3.0.1,vue -version 说我当前的版本是 3.12.0。
我遵循本教程是为了学习如何在我的 VueJS 应用程序中制作弹出窗口。当我编译项目时,我收到一条错误消息:
[Vue warn]: Error in data(): "TypeError: _popperjs_core__WEBPACK_IMPORTED_MODULE_0__.default is undefined"
我将问题追溯到BasePopover.vue组件 - 第一<script>行显示import Popper from "popper.js";
“在我的应用程序中,我将其更改为” import Popper from "@popperjs/core";,但错误仍然不断出现。
所以我按照官方Popper.js 教程来简化事情。我通过安装npm i @popperjs/core(也尝试使用VueCLI如下图所示和通过npm install @popperjs/core --save)。

这是我当前的代码:
<template>
<div id="app">
<button id="button" aria-describedby="tooltip">My button</button>
<div id="tooltip" role="tooltip">My tooltip</div>
</div>
</template>
<script>
//import Popper from "@popperjs/core/lib/popper";
import Popper from "@popperjs/core";
export default {
name: "TestView",
components: {
},
data() {
const …Run Code Online (Sandbox Code Playgroud) 上周我在创建一个新项目并为其提供服务时没有任何问题,但是今天当我使用 vue/cli 创建一个新的默认项目时,我在服务时出现编译错误。
PS E:\Projects\testing> yarn serve
yarn run v1.22.5
$ vue-cli-service serve
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 1 error ??12:22:33
error in ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
Module parse failed: Unexpected token (763:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| class RefImpl {
> _rawValue;
| _shallow;
| _value;
@ ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js 1:0-233 2:0-216 2:0-216 2:0-216 2:0-216 2:0-216 …Run Code Online (Sandbox Code Playgroud) vue-cli ×5
vue.js ×5
javascript ×1
node.js ×1
popper.js ×1
vue-cli-4 ×1
vuejs3 ×1
vuetify.js ×1