Using NPM to import an ES6 module locally without the need for transpiling!

Currently, I am in the process of developing two npm modules locally, namely A and B. It is worth noting that A has B as one of its dependencies.

To streamline the development process, I have opted to utilize npm link for creating symbolic links between package folders. This results in a symlink being present inside the node_modules folder of A, linking it to B's project folder.

However, upon initiating A with node --harmony, there arises an issue where the runtime raises concerns about B making use of ES6 language features. Interestingly, A itself does not encounter any problems regarding its own utilization of ES6 language features.

Is there a way for me to incorporate a non-transpiled ES6 module as a dependency?

Answer №1

Uncertain of your end goal, but in my process of module development, I ensure that when a module is needed by myself or others, an es5 file is placed in the dist folder for dependency. This allows the es6 file to remain for development purposes while the es5 file is dynamically generated by babel for use.

In the same way you are using babel to transpile your X module, I would do the same for the Y module and rely on that.

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

Summoning within a rigorous mode

I am facing an issue with my configuration object: jwtOptionsProvider.config({ tokenGetter: (store) => { return store.get('token'); }, whiteListedDomains: ['localhost'] }); In strict mode, I ...

What is the best way to obtain the current time in a specific city?

Is there a simpler way to display the current time for a specific location without having to deal with factors like daylight savings time? I am searching for a more straightforward solution to always show the time for a particular city, zip code, or any o ...

Creating dynamic and engaging videos using Angular with the ability to make multiple requests

I am facing an issue while working with videos in Angular. I am fetching the video URLs from an API to embed them in my application using the sanitazer.bypassSecurityTrustResourceUrl function provided by Angular. The videos are being displayed correctly wi ...

What's the best method for concealing components: using a class to hide or removing them from the

I am encountering difficulties in React as I try to add a class to a component after a specific time duration. My goal is to apply the "hidden" class to a loading image, changing it to display: none after a few seconds. However, despite my efforts, I keep ...

Tips for downloading and saving an image in ReactJS

I'm facing an issue with my application that showcases a photo gallery. Each photo has a download button underneath, which should allow users to save the photos on their computers. However, when the photos are downloaded, they are saved as HTML docume ...

Determine the precise location of a screen element with jQuery

Can anyone help me determine the precise position of an element on the current visible screen using jQuery? My element has a relative position, so the offset() function only gives me the offset within the parent. Unfortunately, I have hierarchical divs, ...

Prototype: Discover the solution for handling parameters within Ajax.Responders.register

When using the Prototype framework, I decided to register each Ajax call with Ajax.Responders.register. The main goal was to display an Ajax Spinner only when a request is in progress. However, if a request is completed quickly, there is no need to show th ...

Is there a way to create a self-contained installation package for my Vue application?

Is it possible for my application to be downloaded and installed without requiring internet access after the download is complete? I am looking to create a standalone installer for this purpose. Are there any suggestions on how to go about implementing t ...

A new WordPress tool for transferring information seamlessly between jQuery and PHP before storing it in a database

Having recently delved into this subject, I decided to experiment with the following example: I created a new folder within the plugins directory called "abc-referer" In that folder, I made a PHP file named "abc-referer.php" and included the following PH ...

Sorting dates and amounts in string format with Smart-table

Sorting is a breeze in smart-table, but what about when the date and amount are in string format? How can we sort them? app.controller('basicsCtrl', ['$scope', function (scope) {scope.rowCollection = [ {firstName: 'Laurent', ...

Utilizing Express.js: A Guide to Fetching File Downloads with a POST Method

Although GET requests are successful, I am facing challenges when using POST to achieve the same results. Below are the different code snippets I have attempted: 1. app.post("/download", function (req, res) { res.download("./path"); }); 2. app.post ...

Incorporating interactive markers onto a mapbox map file

I am in search of a method to incorporate markers onto a map I have designed on a webpage. Below is the code snippet for the page: <link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' /> <script s ...

What is the reason behind the escape key not functioning in the Ace editor?

While using the Ace JavaScript editor with vim keybindings, I encountered an issue. Whenever I press the escape key to exit insert mode, the editor loses focus instead of exiting the mode. How can I capture this keypress in all modern browsers so that Ace ...

Send the HTML form data to Django in JSON format using AJAX

I've created an HTML form that I want to use to post data to a URL using AJAX in JSON format. However, I'm encountering an issue where I'm not receiving the response in Django (backend). Can you please help me identify where I might be maki ...

Rotating Images in 3D with CSS

I am looking for guidance on how to create a rotating image effect on a webpage using CSS/JS. The image should rotate into the plane of the page, similar to the example shown in this post. Can you assist me with this? To better illustrate what I'm tr ...

How can we eliminate the 'www' in a URL using NodeJS and Express?

What is the best way to eliminate the 'www' in a URL using NodeJS + Express? For instance, when a client connects to , how can we automatically redirect them to without the 'www'? ...

`Where to include controller.js scripts in an Angular application`

As I dive into learning angular.js with .NET MVC, one major issue that keeps coming up is the fact that many tutorials advise referencing multiple controllers and services in the main (_Layout) page, which can make it quite messy. Although it may seem sim ...

Having an issue with Vue Router in Vue 2.0, encountering an error

I encountered the following error message: [Vue warn]: Unknown custom element: <router-view> - did you register the component correctly? For recursive components, make sure to provide the "name" option. I double-checked that the Vue router ...

Is there a way to overlay a 'secret' grid on top of a canvas that features a background image?

I am currently working on developing an HTML/JS turn-based game, where I have implemented a canvas element using JavaScript. The canvas has a repeated background image to resemble a 10x10 squared board. However, I want to overlay a grid on top of it so tha ...

Issue when passing JSON as props: Unable to access the property 'name' because it is undefined

I have a JSON request that returns a JSON object. I want to pass this data to a component function for display purposes, but I'm encountering the following error: Cannot read property 'name' of undefined I've outlined the issue below ...