25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Removing unnecessary<br />

dependencies <strong>and</strong> files<br />

Let's begin by removing the Node dependencies we no longer need. We'll keep<br />

axis as it'll be used in a later chapter, <strong>and</strong> cross-env because it ensures our NPM<br />

scripts can be run in a variety of environments. We'll get rid of the rest: $ npm<br />

uninstall bootstrap-sass jquery lodash --save-dev<br />

This comm<strong>and</strong> will leave your dev dependencies looking like this.<br />

package.<strong>js</strong>on: "devDependencies": { "axios": "^0.17", "cross-env": "^5.1",<br />

"laravel-mix": "^1.4", "vue": "^2.5.3" }<br />

Next, we'll remove the files we don't need. This includes several of the<br />

JavaScript assets, all of the Sass plus the welcome view: $ rm -rf \<br />

resources/assets/<strong>js</strong>/app.<strong>js</strong> \ resources/assets/<strong>js</strong>/bootstrap.<strong>js</strong> \<br />

resources/assets/<strong>js</strong>/components/* \ resources/assets/sass \<br />

resources/views/welcome.blade.php<br />

Since we're removing all the Sass files, we'll also need to remove the sass method<br />

in the Mix configuration.<br />

webpack.mix.<strong>js</strong>: let mix = require('laravel-mix'); mix .<strong>js</strong>('resources/assets/<strong>js</strong>/app.<strong>js</strong>',<br />

'public/<strong>js</strong>') ;<br />

Now our frontend app is free from clutter <strong>and</strong> we can move the prototype files<br />

into their new home.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!