Created
December 25, 2017 15:22
-
-
Save tje3d/6e0241693d977173307dfde502be02b9 to your computer and use it in GitHub Desktop.
VueJS Dynamic Import Using Laravel-Mix - Webpack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var master = new Vue({ | |
el: '#master', | |
components: { | |
TicketWidget : () => import('./panel/inc/ticket-widget.vue'), | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var master = new Vue({ | |
el: '#master', | |
components: { | |
TicketWidget : require('./panel/inc/ticket-widget.vue'), | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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