ChristianPav
1 month ago
254
4
Mix

Can I publish JS library with laravel-mix?

Posted 1 month ago by ChristianPav

Is there a way to use laravel-mix to publish a library to npm? It seems like I can't have a index.js file export a few files and have that be used in an npm package.

example:

// index.js - In library

export  * from './reuseablestuff';
// app.js - In Project

import {someFunc} from 'reusable-library';

someFunc();

But it seems the compiled file doesn't export anything. Is there a way to expose a library using mix?

Please sign in or create an account to participate in this conversation.