Rollup - incomplete packaging due to missing child component in repository

After working on my component library in vue and using rollup to wrap it up, I encountered an issue with the mixins not getting included in the final library. Initially, I suspected that the problem lied in the paths since most of the mixins were local.

In my original setup:

import mixin from '../../mixins/color'

Repo folder structure
   - dist //output
   - src //All files related to the actual components within the library
     - components
       - comps
          - alert //general components
          - inputs //input components
          - layout //layout components /row/col
     - mixins
     - utilities
     - entry.js //rollup points to this 
  - ...  //Used nuxt for component development focusing on SSR with additional folders excluded in rollup process

It appeared that native rollup did not support indirect imports so I tried integrating rollup-plugin-includepaths. My understanding was that specifying the required paths in the imports would resolve the issue.

Subsequently, I added rollup-plugin-includepaths to the plugins section in rollup.config.js, including the root path and output directory as options:

includePaths({
        paths: ['src/components/', 'src/mixins/', 'src/utilities/'],
        extensions: ['.js', '.vue']
      }),

**Unfortunately, this solution did not work.**

I then attempted to eliminate relative imports and create aliases for each necessary directory, but that also proved unsuccessful.

The problem persists where all imported mixins are not being compiled into the final product even when they are added as

mixin: [mixins] //whatever they may be
within the component?!

What am I missing here?

// rollup.config.js (extract)
...
// Additional configurations for different build formats omitted for brevity
...

Update

Even after moving the imported components out of the mixin and directly adding them to the component, I faced the same outcome. This leaves me clueless about what needs to be done.

TL;DR

None of the child components are getting included in the compiled '.js' files during the rollup process.

Answer №1

At times, it can be challenging to ensure that only the relevant information is included, and the question mentioned above exemplifies this.

The issue lies within a larger component that I had lazily imported the children into.

For example:

components:{
 comp: ()=>import('comp') ///Does not work
}

I have since corrected this by switching to the standard approach:

import comp from 'comp'
components:{
   comp
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing React forwardRef with a functional component

Looking at my code, I have defined an interface as follows: export interface INTERFACE1{ name?: string; label?: string; } Additionally, there is a function component implemented like this: export function FUNCTION1({ name, label }: INTERFACE1) { ...

Setting up only two input fields side by side in an Angular Form

I'm fairly new to Angular development and currently working on creating a registration form. I need the form to have two columns in a row, with fields like Firstname and Lastname in one row, followed by Phone, Email, Password, and Confirm Password in ...

Certain individuals are experiencing difficulties accessing my Google application

I have created a node.js application with a Google login feature using the following packages: "passport": "^0.3.2" "passport-google-oauth": "^1.0.0" However, I am facing an issue where only a few users are able to access this feature. Below is the code ...

I aim to combine a few variables of uncertain types within a string

When using concatenation with pluses, it could potentially result in unexpected outcomes. My desired result is 123. var one = 1; var two = 2; var three = '3'; var result = one + two + three; alert(result);//I want-> 123 ...

Incorporating a Vue plugin within a different Vue plugin

I am revamping my website by incorporating Vue in the frontend and Django Rest Framework in the backend. To streamline the authentication/headers/error handling for all AJAX calls, I decided to centralize this logic within a shared file. Thus, I created a ...

Enhancing Vue with stylish components

My Vue component is quite basic, with the following structure: <script> export default { props: { source: { type: String, required: true, } }, } </script> <template> <div class="imageItem"> <img class="image" :data-srcse ...

Connecting Mailchimp with WordPress without using a plugin can lead to a Bad Request 400 error when trying to

I'm attempting to connect with Mailchimp using an Ajax request without relying on a plugin, but I keep encountering a 400 bad request error. The code provided below utilizes vanilla JS for Ajax and the function required for integration with Mailchimp. ...

Adjust the size of icon passed as props in React

Below is the component I am working on: import ListItemButton from '@mui/material/ListItemButton'; import ListItemIcon from '@mui/material/ListItemIcon'; import Tooltip from '@mui/material/Tooltip'; const MenuItem = ({data, o ...

Separate a tab delimited text file and store it into an array using JavaScript

Looking to parse a text file with tab-separated values in JavaScript and add them to an array? Here's how you can achieve this while excluding the header: Id Symbol 1 A 2 B 3 C 4 D 5 E 6 F 7 G This is what I have attempted so far: va ...

Steps to refresh a Flask-powered web page following data reception

I'm currently working on a straightforward web project that involves retrieving data, processing it, and then displaying the results on the page. However, even though the data is successfully written to an sqlite database by the spider, it doesn' ...

ReactJS - How to prevent infinite loops when using the setState method inside the onChange

My attempt at creating a component using codemirror seems to be failing. When I try to update the state of my main component, the application breaks the browser. My research indicates that there might be an infinite loop causing this issue, especially when ...

Angular's $location is reverting back after the modification

When using Angular, I encountered an issue where the user was not redirected to the view page after submitting a form. To handle this, I attached the following function to the scope: $scope.create = function () { return $scope.customer.$save({}, funct ...

Steps to switch the displayed ionicon when the menu is toggled

My goal is to display the 'menu-outline' ionicon on my website until it is clicked, at which point the icon will change to 'close-outline' and vice versa. I am utilizing jQuery for this functionality. Although I am aware of how to togg ...

VUE3 and IONIC error message: "The property 'foo' is not defined on the type '{ bar(): any; }'"

I'm encountering an issue with Vue3 + Ionic. I'm attempting to create a component that retrieves an image using the computed property and accesses a variable from the props. Below is my code: Home.vue <MenuIcon name="subscribe" file ...

The Ember.run.throttle method is not supported by the Object Function as it does not have a throttle method within the Ember.Mixin

I have a controller that has an onDragEvent function: controller = Em.Object.create( { onDragEvent: function() { console.log("Drag Event"); } }); Additionally, I have a Mixin called 'Event': Event = Ember.Mixin.create( { at ...

Serialize a series of select boxes to optimize for AJAX POST requests

To better explain my issue, let's consider a simple example: Imagine I have a form that collects information about a user: <form action="#" method="post" id="myform"> <input type="text" name="fname" /> <input type="text" name= ...

Eliminate unnecessary components during the JSON to CSV conversion process

I have a JSON data set that looks like this: {"id":1,"name":"Sam","birthday":"12December","age":"15"}, {"id":2,"name":"Ash","birthday":"12January","age":"23"} After passing the data through the function: ConvertToCSV(data) I can extract id, name, birth ...

Creating a Validation Form using either PHP or JavaScript

I need to create a form with the following columns: fullname, email, mobile, and address. If the visitor fills out the mobile field, they should only be allowed to enter numbers. And if the visitor fills out the email field, they should only be allowed to ...

Testing nested mocked functions can be achieved by setting up the necessary mocks

How can I create tests for mocked functions within a mocked function? My goal is to verify that my publish mocked function is called only once. jest.mock('amqplib', () => ({ connect: jest.fn(() => Promise.resolve({ createChannel: jes ...

The module 'react/lib/React' could not be located within the file 'ReactTestUtils.js'

Setting up unit-tests for a React Native project using ReactTestUtils is causing an issue with npm test. The error message I receive is: Cannot find module 'react/lib/React' from 'ReactTestUtils.js' I suspect that my dependencies are ...