After diligently following the CoreUI documentation guidelines for integrating in vuejs development, I have discovered specific components designed for use within a vuejs environment. The documentation outlines the necessary installation commands which I executed as follows:
git clone https://github.com/coreui/free-bootstrap-admin-template.git my-project
$ cd my-project
$ npm install.
Upon completion, I transferred the files from the /src folder to the /resources directory of my Laravel project, adding the following lines of code:
mix.js('resources/js/app.js', 'public/js')
.js('resources/js/bootstrap.js', 'public/js')
/*This is the mainjs on template /src*/
.js('resources/js/main.js', 'public/js') /*This line is added*/
.sass('resources/sass/app.scss', 'public/css');
mix.browserSync({
proxy: 'http://localhost:8000'
});
To compile the code in the /main.js file, which executes template dependencies for webpack
Upon running “npm run watch”, an error occurred:
ERROR in ./resources/js/router/index.js
Module build failed: SyntaxError: Unexpected token (68:31)
66 |
67 | // Views
> 68 | const Dashboard = () => import('@/views/Dashboard')
| ^
69 |
70 | const Colors = () => import('@/views/theme/Colors')
71 | const Typography = () => import('@/views/theme/Typography')
I then modified the lines containing
const Dashboard = () => import('@/views/Dashboard')
and replaced them with
import Dashboard from 'resources/js/views/Dashboard.vue'
This adjustment resulted in another error:
ERROR in ./resources/js/router/index.js
Module build failed: SyntaxError: Unexpected token (64:31)
62 |
63 | Containers
> 64 | const DefaultContainer = () => import('resources/js/views/Dashboard.vue')
| ^
65 |
66 |
67 | // // Views
Finding documentation on implementing VueJS templates into Laravel projects proves challenging, making the integration of these templates complex. If you have any suggestions or solutions regarding this matter, please feel free to comment below.