Skip to content

Commit

Permalink
Unminifiy assets to allow for development debugging and replace gulp/…
Browse files Browse the repository at this point in the history
…elixir with webpack/laravel-mix
  • Loading branch information
talvbansal committed Oct 3, 2017
1 parent 15a28cc commit 23ae85f
Show file tree
Hide file tree
Showing 11 changed files with 40,314 additions and 1,061 deletions.
18 changes: 0 additions & 18 deletions gulpfile.js

This file was deleted.

4 changes: 4 additions & 0 deletions mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"/public/js/media-manager.js": "/public/js/media-manager.js",
"/public/css/media-manager.css": "/public/css/media-manager.css"
}
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"devDependencies": {
"axios": "^0.16.2",
"bootstrap-notify": "^3.1.3",
"dropzone": "^4.3.0",
"gulp": "^3.9.1",
"hammerjs": "^2.0.8",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.8",
"cross-env": "^5.0.1",
"laravel-mix": "^1.0",
"lodash": "^4.16.2",
"moment": "^2.17.1",
"vue": "^2.3.2",
"vue": "^2.3.0",

This comment has been minimized.

Copy link
@ruchernchong

ruchernchong Oct 3, 2017

Contributor

Not using ^2.4.0 instead?

This comment has been minimized.

Copy link
@talvbansal

talvbansal Oct 3, 2017

Author Owner

certainly can do the ^ will give 2.x releases wont it?

This comment has been minimized.

Copy link
@ruchernchong

ruchernchong Oct 3, 2017

Contributor

Okay, I just tried and yes. Yarn does pull in 2.4.4 for now.

"vue-touch2": "^1.0.0"
}
}
4,347 changes: 4,346 additions & 1 deletion public/css/media-manager.css

Large diffs are not rendered by default.

32,713 changes: 32,700 additions & 13 deletions public/js/media-manager.js

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions resources/assets/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
* a simple convenience so we don't have to attach every token manually.
*/

if (Laravel.csrfToken) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = Laravel.csrfToken;
} else {

let token = document.head.querySelector('meta[name="csrf-token"]');
let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else if(Laravel){
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = Laravel.csrfToken;
}else{
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/components/MediaManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
uploadMultiple: true,
url: `${this.prefix}browser/file`,
headers: {
"X-CSRF-TOKEN": window.Laravel.csrfToken
"X-CSRF-TOKEN": window.axios.defaults.headers.common['X-CSRF-TOKEN']
},
sending: (file, xhr, form) => {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions resources/assets/sass/media-manager.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'icon-code.scss';
@import "animate";
@import "dropzone";

$editor-height: 60vh;
Expand Down
5 changes: 5 additions & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let mix = require('laravel-mix');

mix.sass('resources/assets/sass/media-manager.scss', 'public/css/')
.js('resources/assets/js/media-manager.js', 'public/js/')
.copy('resources/assets/fonts', 'public/fonts/')
Loading

0 comments on commit 23ae85f

Please sign in to comment.