Have you tried example at: https://laravel.com/docs/6.x/mix#working-with-scripts and https://laravel.com/docs/6.x/mix#vanilla-js
Sep 16, 2020
4
Level 12
Can I publish JS library with laravel-mix?
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 or to participate in this conversation.