Support the ongoing development of Laravel.io →
posted 6 years ago
Mix

hello, because I have some big vue component that only require to be available on some spécific file, I would like to split it.

But it seems not so easy to do.

So I create a .vue file and and a .js file with

someModal.js

import Vue from 'vue';
import SomeModal from './someModal.vue';

Vue.component('some-modal', SomeModal);

someModal.vue

<template>
	<div>
	This is a test
	</div>
</template>

<script>

	export default {
		name: 'someModal',
	}
</script>

in the webpack.mix.js if I do

mix.js('resources/js/components/vue/independent/someModal.js', 'public/js/vue');

it's overwritten by my general js file or it's the only js file outputted

Any idea how to split it ?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Grummfy grummfy Joined 27 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.