Problem with Laravel Mix when using async vue component
See original GitHub issueDescription:
Laravel-Mix version : 5
My webpack.mix.js file:
const mix = require('laravel-mix');
require('laravel-mix-purgecss');
const tailwindcss = require('tailwindcss');
mix.js('resources/assets/js/app.js', 'assets/js')
.sass('resources/assets/sass/app.scss', 'assets/css')
.sass('resources/assets/sass/vendor.scss', 'assets/css')
.copy('resources/assets/images', 'assets/images')
.options({
processCssUrls: false,
postCss: [tailwindcss('./tailwind.config.js')],
})
.extract()
.purgeCss()
.browserSync('http://localhost:8080');
I created some Vue component and tried to include them as async:
import Vue from 'vue'
import App from './App.vue'
import Router from 'vue-router'
const Dashboard = () => import(/* webpackChunkName: "./assets/js/dashboard" */ './components/Dashboard')
const DashboardHome = () => import(/* webpackChunkName: "./assets/js/dashboard" */ './pages/Home')
import store from './store'
Vue.config.productionTip = false
Vue.use(Router)
const routes = [
{ path: '/', redirect: { name: 'DashboardHome' } },
{ path: '/dashboard', component: Dashboard, children: [
{ path: '/', redirect: { name: 'DashboardHome' } },
{ path: 'home', name: 'DashboardHome', component: DashboardHome }
]
}
]
const router = new Router({
mode: 'hash',
routes
})
new Vue({
render: h => h(App),
router,
store
}).$mount('#app')
The files (js/css) are created but css files contains JS Code when running yarn run prod
https://www.dropbox.com/s/osakt96rgl83sx0/Screenshot 2020-06-08 22.28.51.png?dl=0
https://www.dropbox.com/s/iw744tfq30xt1v2/Screenshot 2020-06-08 22.29.19.png?dl=0
How can I fix this issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Problem with Laravel Mix when using async vue component
Description: Laravel-Mix version : 5 My webpack.mix.js file: const mix = require('laravel-mix'); require('laravel-mix-purgecss'); ...
Read more >Problem with Laravel Mix when using async vue ... - Laracasts
Problem with Laravel Mix when using async vue component. Laravel-Mix version : 5. My webpack.mix.js file: Copy Code const mix = require('laravel-mix'); ...
Read more >Laravel 8 Mix npm run development error with vue.js
I've laravel Vue js project. I need to make changes to our project but when I try to use npm run development to...
Read more >Asset Bundling (Vite) - The PHP Framework For Web Artisans
However, it lacks some features that Laravel Mix supports, such as the ability to copy arbitrary assets into the build that are not...
Read more >Another issue with laravel-mix and async components - Reddit
Like I said last night, Mix 4.0 has tons of problems with async/dynamic imports. This isn't a problem with Mix, but rather the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@itsursujit thanks for your feedback - much appreciated - I’ll dig into it again a bit later again.
All seems fine to me.
my code now is: