2018-03-28 07:18:25 +08:00
|
|
|
'use strict';
|
2017-12-08 08:43:09 +08:00
|
|
|
|
2018-03-28 05:34:37 +08:00
|
|
|
const mix = require('laravel-mix');
|
2017-12-08 08:43:09 +08:00
|
|
|
|
2017-12-31 02:03:45 +08:00
|
|
|
/**
|
2018-03-29 03:01:38 +08:00
|
|
|
* COPY ASSETS
|
|
|
|
* Copy required assets
|
2017-12-31 02:03:45 +08:00
|
|
|
*/
|
|
|
|
|
2018-03-28 05:34:37 +08:00
|
|
|
mix.copy('node_modules/bootstrap3/fonts/*.woff2', 'public/assets/fonts/');
|
|
|
|
mix.copy('node_modules/bootstrap3/fonts/*.woff2', 'public/assets/admin/fonts/');
|
|
|
|
mix.copy('node_modules/x-editable/dist/bootstrap3-editable/img/*', 'public/assets/admin/img/');
|
2018-03-29 03:01:38 +08:00
|
|
|
mix.copy('node_modules/jquery/dist/jquery.js', 'public/assets/global/js/');
|
|
|
|
mix.copy('node_modules/flag-icon-css/flags/', 'public/assets/global/flags/');
|
2018-04-01 04:57:30 +08:00
|
|
|
mix.copy('node_modules/leaflet/dist/images/', 'public/assets/global/css/images/');
|
2018-03-29 03:01:38 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* DEFAULT SKIN FRONTEND FILES
|
|
|
|
*/
|
|
|
|
|
|
|
|
mix.sass('resources/sass/now-ui/now-ui-kit.scss',
|
|
|
|
'public/assets/frontend/css/now-ui-kit.css')
|
|
|
|
.options({
|
|
|
|
processCssUrls: false,
|
|
|
|
compressed: true
|
2018-04-04 08:21:42 +08:00
|
|
|
}).sourceMaps();
|
2017-12-31 02:03:45 +08:00
|
|
|
|
2017-12-28 08:08:37 +08:00
|
|
|
/**
|
|
|
|
* ADMIN REQUIRED FILES
|
|
|
|
*/
|
|
|
|
|
2018-03-28 05:34:37 +08:00
|
|
|
mix.sass('resources/sass/admin/paper-dashboard.scss',
|
|
|
|
'public/assets/admin/css/vendor.min.css')
|
|
|
|
.styles([
|
|
|
|
'node_modules/bootstrap3/dist/css/bootstrap.css',
|
|
|
|
'node_modules/animate.css/animate.css',
|
|
|
|
'node_modules/icheck/skins/square/blue.css',
|
2018-03-29 04:51:44 +08:00
|
|
|
'node_modules/select2/dist/css/select2.css',
|
2018-04-10 08:32:38 +08:00
|
|
|
'node_modules/pikaday/css/pikaday.css',
|
2018-03-28 05:34:37 +08:00
|
|
|
'node_modules/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css',
|
|
|
|
'node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css',
|
|
|
|
'public/assets/admin/css/vendor.min.css',
|
2018-03-29 04:51:44 +08:00
|
|
|
], 'public/assets/admin/css/vendor.css').version()
|
2018-03-28 07:45:25 +08:00
|
|
|
.options({
|
|
|
|
compressed: true
|
|
|
|
})
|
2018-03-29 03:01:38 +08:00
|
|
|
.sourceMaps();
|
2017-12-28 08:08:37 +08:00
|
|
|
|
|
|
|
mix.scripts([
|
2018-03-29 12:04:53 +08:00
|
|
|
'node_modules/lodash/lodash.js',
|
2018-03-29 04:51:44 +08:00
|
|
|
'node_modules/jquery/dist/jquery.js',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/moment/moment.js',
|
2018-03-28 07:45:25 +08:00
|
|
|
//'node_modules/axios/dist/axios.js',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/bootstrap3/dist/js/bootstrap.js',
|
|
|
|
'node_modules/bootstrap3/js/collapse.js',
|
|
|
|
'node_modules/bootstrap3/js/transition.js',
|
|
|
|
'node_modules/popper.js/dist/umd/popper.js',
|
|
|
|
'node_modules/popper.js/dist/umd/popper-utils.js',
|
|
|
|
'node_modules/select2/dist/js/select2.js',
|
2018-03-28 07:45:25 +08:00
|
|
|
//'node_modules/leaflet/dist/leaflet.js',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/icheck/icheck.js',
|
2018-04-10 08:32:38 +08:00
|
|
|
'node_modules/pikaday/pikaday.js',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.js',
|
|
|
|
'node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js',
|
|
|
|
'node_modules/jquery-pjax/jquery.pjax.js',
|
2018-03-28 04:46:54 +08:00
|
|
|
'node_modues/paper-dashboard/assets/js/paper-dashboard.js',
|
|
|
|
], 'public/assets/admin/js/vendor.js');
|
2018-03-14 22:07:41 +08:00
|
|
|
|
2018-03-28 04:46:54 +08:00
|
|
|
mix.copy('node_modules/icheck/skins/square/blue*.png', 'public/assets/admin/css');
|
2017-12-31 00:38:18 +08:00
|
|
|
|
2017-12-28 08:08:37 +08:00
|
|
|
/**
|
2018-01-10 08:49:15 +08:00
|
|
|
* SYSTEM REQUIRED AND GLOBAL VENDOR FILES
|
2017-12-28 08:08:37 +08:00
|
|
|
*/
|
|
|
|
|
2018-03-29 04:51:44 +08:00
|
|
|
mix.scripts([
|
2018-03-29 12:04:53 +08:00
|
|
|
'node_modules/lodash/lodash.js',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/jquery/dist/jquery.js',
|
|
|
|
'node_modules/select2/dist/js/select2.js',
|
2018-08-20 23:25:40 +08:00
|
|
|
'node_modules/cookieconsent/build/cookieconsent.min.js',
|
2018-03-29 04:51:44 +08:00
|
|
|
], 'public/assets/global/js/vendor.js');
|
2017-12-28 08:08:37 +08:00
|
|
|
|
|
|
|
mix.styles([
|
2018-03-30 02:48:50 +08:00
|
|
|
'node_modules/select2/dist/css/select2.css',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/leaflet/dist/leaflet.css',
|
|
|
|
'node_modules/flag-icon-css/css/flag-icon.css',
|
2018-08-20 23:25:40 +08:00
|
|
|
'node_modules/cookieconsent/build/cookieconsent.min.css',
|
2018-03-29 04:51:44 +08:00
|
|
|
], 'public/assets/global/css/vendor.css')
|
2018-03-14 22:07:41 +08:00
|
|
|
.options({
|
2018-04-01 04:57:30 +08:00
|
|
|
//processCssUrls: true,
|
2018-03-14 22:07:41 +08:00
|
|
|
compressed: true
|
|
|
|
})
|
2018-03-28 07:45:25 +08:00
|
|
|
.sourceMaps();
|
2017-12-28 08:08:37 +08:00
|
|
|
|
2017-12-30 06:56:46 +08:00
|
|
|
/**
|
|
|
|
* INSTALLER VENDOR FILES
|
|
|
|
*/
|
|
|
|
|
2018-02-13 00:51:04 +08:00
|
|
|
mix.styles([
|
2018-03-29 03:01:38 +08:00
|
|
|
'node_modules/bootstrap3/dist/css/bootstrap.css',
|
|
|
|
'public/assets/frontend/css/now-ui-kit.css',
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/select2/dist/css/select2.css',
|
|
|
|
'node_modules/flag-icon-css/css/flag-icon.css',
|
2018-03-29 03:01:38 +08:00
|
|
|
], 'public/assets/installer/css/vendor.css')
|
2018-03-14 22:07:41 +08:00
|
|
|
.options({
|
2018-03-31 08:05:15 +08:00
|
|
|
//processCssUrls: false,
|
2018-03-14 22:07:41 +08:00
|
|
|
compressed: true
|
|
|
|
})
|
2018-03-28 07:45:25 +08:00
|
|
|
.sourceMaps();
|
2018-02-13 00:51:04 +08:00
|
|
|
|
2017-12-30 06:56:46 +08:00
|
|
|
mix.scripts([
|
2018-03-14 22:07:41 +08:00
|
|
|
'node_modules/jquery/dist/jquery.js',
|
|
|
|
'node_modules/select2/dist/js/select2.js',
|
2018-03-28 03:46:32 +08:00
|
|
|
], 'public/assets/installer/js/vendor.js');
|
2017-12-30 06:56:46 +08:00
|
|
|
|
2018-03-28 05:34:37 +08:00
|
|
|
/**
|
|
|
|
* COMMON JS STUFF
|
|
|
|
*/
|
|
|
|
|
2018-03-13 06:30:52 +08:00
|
|
|
// These should go into the separate vendor.js file
|
|
|
|
const extract = [
|
2018-03-14 22:07:41 +08:00
|
|
|
'lodash',
|
|
|
|
'popper.js',
|
|
|
|
'jquery',
|
|
|
|
'select2',
|
|
|
|
'pjax',
|
|
|
|
'leaflet',
|
|
|
|
'Leaflet.Geodesic',
|
|
|
|
'leaflet-rotatedmarker'
|
2018-03-28 03:46:32 +08:00
|
|
|
];
|
2018-03-13 06:30:52 +08:00
|
|
|
|
2018-03-28 07:18:25 +08:00
|
|
|
mix.js('resources/js/frontend/app.js', 'public/assets/frontend/js/app.js');
|
2018-03-28 07:45:25 +08:00
|
|
|
mix.js('resources/js/installer/app.js', 'public/assets/installer/js/app.js');
|
|
|
|
mix.js('resources/js/admin/app.js', 'public/assets/admin/js/app.js');
|
2018-03-13 06:30:52 +08:00
|
|
|
|
2018-03-28 07:18:25 +08:00
|
|
|
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()
|
|
|
|
]
|
|
|
|
});
|