Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let mix = require('laravel-mix');
- /*
- |--------------------------------------------------------------------------
- | Mix Asset Management
- |--------------------------------------------------------------------------
- |
- | Mix provides a clean, fluent API for defining some Webpack build steps
- | for your Laravel application. By default, we are compiling the Sass
- | file for the application as well as bundling up all the JS files.
- |
- */
- mix
- .js('resources/assets/js/app.js', 'public/static/js')
- .js('resources/assets/js/login.js', 'public/static/js')
- .sass('resources/assets/sass/app.scss', 'public/static/css')
- .copyDirectory('resources/assets/images', 'public/static/images')
- .copyDirectory('resources/assets/icons', 'public/static/icons')
- .copyDirectory('resources/assets/fonts', 'public/static/fonts')
- .copyDirectory('node_modules/font-awesome/fonts', 'public/static/fonts')
- .copyDirectory('node_modules/element-ui/lib/theme-chalk/fonts', 'public/static/fonts')
- .options({
- processCssUrls: false
- });
- if (mix.inProduction()) {
- mix.version();
- }
- mix.disableSuccessNotifications();
- Mix.listen('configReady', (webpackConfig) => {
- if (Mix.isUsing('hmr')) {
- // Remove leading '/' from entry keys
- webpackConfig.entry = Object.keys(webpackConfig.entry).reduce((entries, entry) => {
- entries[entry.replace(/^\//, '')] = webpackConfig.entry[entry];
- return entries;
- }, {});
- // Remove leading '/' from ExtractTextPlugin instances
- webpackConfig.plugins.forEach((plugin) => {
- if (plugin.constructor.name === 'ExtractTextPlugin') {
- plugin.filename = plugin.filename.replace(/^\//, '');
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement