Skip to content

Instantly share code, notes, and snippets.

@tje3d
Created December 25, 2017 15:22
Show Gist options
  • Save tje3d/6e0241693d977173307dfde502be02b9 to your computer and use it in GitHub Desktop.
Save tje3d/6e0241693d977173307dfde502be02b9 to your computer and use it in GitHub Desktop.
VueJS Dynamic Import Using Laravel-Mix - Webpack
var master = new Vue({
el: '#master',
components: {
TicketWidget : () => import('./panel/inc/ticket-widget.vue'),
}
});
var master = new Vue({
el: '#master',
components: {
TicketWidget : require('./panel/inc/ticket-widget.vue'),
}
});
mix.js([
process.env.NODE_ENV == 'production' ? 'resources/js/panel.js' : 'resources/js/panel_dev.js',
], 'public/dist/panel.js')
// to fix path issue
.webpackConfig({
output: {
publicPath: '/',
chunkFilename: 'dist/[name].[chunkhash].js'
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment