I want to modify a .vue
file that is located in the node_modules
folder, but when I change something in its code, these changes have no effect.
I know this is a bad approach, but I need it for a test
<template>
<div :class="cx('root')" data-scrollselectors=".p-datatable-wrapper" v-bind="ptmi('root')">
test test test test test test test <<<<--------- my test changes
<slot></slot>
...
And as you can see, nothing has changed, the text hasn’t appeared. The same will happen with anything else in this file: script or styles.
component in browser
I’m using Nuxt 3 + Vite, and PrimeVue3 for component library.
Here is Nuxt configuration:
import { resolve } from 'pathe'
export default defineNuxtConfig({
app: {
},
css: ['~/assets/scss/main.scss'],
devServer: {
port: 3000,
host: '127.0.0.1',
},
vite: {
},
site: {
url: 'http://127.0.0.1:3000',
trailingSlash: true,
},
security: {
headers: {
crossOriginEmbedderPolicy: 'unsafe-none',
contentSecurityPolicy: {
'img-src': [''self'', 'data:', '*', 'blob:'],
'connect-src': [''self'', 'http://127.0.0.1:8000', 'https:'],
},
xXSSProtection: false,
},
xssValidator: false,
},
typescript: {
typeCheck: 'build',
},
modules: ['@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', '@nuxtjs/tailwindcss', 'nuxt-graphql-middleware', '@nuxtjs/seo', 'nuxt-splide', '@nuxtjs/i18n', 'nuxt-icon', 'nuxt-primevue', '@nuxt/image', '@formkit/auto-animate/nuxt', '@vueuse/nuxt', 'nuxt-lodash', 'nuxt-security', 'nuxt-monaco-editor', '@nuxt/fonts'],
imports: {
dirs: ['gql', 'graphql'],
},
piniaPersistedstate: {
cookieOptions: {
sameSite: 'strict',
},
storage: 'cookies',
},
graphqlMiddleware: {
graphqlEndpoint: process.env.GRAPHQL_ENDPOINT || 'http://127.0.0.1:8000/graphql/',
debug: true,
devtools: true,
outputDocuments: true,
downloadSchema: true,
autoImportPatterns: ['**/*.gql', '**/*.graphql'],
enableFileUploads: true,
},
runtimeConfig: {
public: {
admin_suffix: 'tuz', // Це колись переробити
file_upload_url: process.env.FILE_ULOAD_URL || 'http://127.0.0.1:8000/file_browser/upload_to_temp/?format=json',
},
},
experimental: {
defaults: {
nuxtLink: {
trailingSlash: 'append',
},
},
},
i18n: {
locales: [
{
code: 'uk',
name: 'UK',
iso: 'uk-UA',
file: 'uk.ts',
},
{
code: 'en',
name: 'EN',
iso: 'en-US',
file: 'en.ts', // add file name for each locale
},
],
defaultLocale: 'uk',
lazy: true,
langDir: 'locales',
detectBrowserLanguage: false,
vueI18n: './i18n.config.ts',
},
primevue: {
usePrimeVue: true,
options: {
unstyled: true,
ripple: true,
},
importPT: { from: resolve(__dirname, './assets/presets/wind/') },
components: {
prefix: 'Prime',
},
},
compatibilityDate: '2024-08-21',
devtools: {
enabled: true,
},
})
I have also tried to change non-vue files, regular .js
and everything works fine if I clear the nuxt and vite cache with npx nuxi cleanup
command, but with .vue
it didn’t work out and no changes have any effect.
Is there really no way to change .vue
files inside node_modules
?
4