strip unnecessary imports from js app files

This commit is contained in:
Nabeel Shahzad
2018-03-27 18:18:25 -05:00
parent 1518b8d4f7
commit a1a8c6f141
18 changed files with 1508 additions and 299 deletions

View File

@@ -2,19 +2,11 @@
*
*/
'use strict'
'use strict';
const mix = require('laravel-mix');
const webpack = require('webpack');
mix.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
]
});
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
/**
* GENERAL FILES
@@ -69,10 +61,6 @@ mix.copy('node_modules/icheck/skins/square/blue*.png', 'public/assets/admin/css'
mix.copy('node_modules/jquery/dist/jquery.js', 'public/assets/system/js/');
mix.copy('node_modules/flag-icon-css/flags/', 'public/assets/system/flags/');
mix.autoload({
'jquery': ['jQuery', '$'],
});
mix.scripts([
'node_modules/lodash/lodash.js',
'node_modules/axios/dist/axios.js',
@@ -129,7 +117,7 @@ mix.sass('resources/sass/now-ui/now-ui-kit.scss',
processCssUrls: false,
compressed: true
})
.sourceMaps()
;
/**
@@ -148,8 +136,19 @@ const extract = [
'leaflet-rotatedmarker'
];
mix.js('resources/js/frontend/app.js', 'public/assets/frontend/js')
//.extract(extract)
.sourceMaps();
mix.js('resources/js/frontend/app.js', 'public/assets/frontend/js/app.js');
//mix.js('resources/js/admin/app.js', 'public/assets/admin/js/app.js');
//mix.js('resources/js/admin/app.js', 'public/assets/admin/js');
mix.webpackConfig({
/*entry: {
admin: __dirname + "/resources/js/admin/app.js",
app: __dirname + "/resources/js/frontend/app.js",
},
output: {
filename: "[name].js",
path: __dirname + "/public/js/",
},*/
plugins: [
//new BundleAnalyzerPlugin()
]
});