Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'assets/css/*.css'
]
}, Mix.browserSync),
{
reload : false
}
)
);
}
if (Mix.options.notifications) {
plugins.push(
new webpackPlugins.WebpackNotifierPlugin({
title : 'Ultimate Page Builder',
alwaysNotify : true,
contentImage : Mix.Paths.root('images/logo.png')
})
);
}
if (Mix.copy.length) {
new webpackPlugins.CopyWebpackPlugin(Mix.copy);
}
if (Mix.entry().hasExtractions()) {
// Abstract a common file between apps.
plugins.push(
new webpack.optimize.CommonsChunkPlugin({
names : Mix.entry().getExtractions().map((manifest) => manifest.replace('manifest', 'upb-common')),
minChunks : Infinity,
})
);
})
);
}
if (Mix.options.versioning) {
plugins.push(
new webpack[Mix.inProduction ? 'HashedModuleIdsPlugin': 'NamedModulesPlugin'](),
new webpackPlugins.WebpackChunkHashPlugin()
);
}
if (Mix.options.purifyCss) {
let PurifyCSSPlugin = require('purifycss-webpack');
// By default, we'll scan all Blade and Vue files in our project.
let paths = glob.sync(Mix.Paths.root('resources/views/**/*.blade.php')).concat(
Mix.js.reduce((carry, js) => {
return carry.concat(glob.sync(js.entry.map(entry => entry.base) + '/**/*.vue'));
}, [])
);
plugins.push(new PurifyCSSPlugin(
Object.assign({ paths }, Mix.options.purifyCss, { minimize: Mix.inProduction })
));
}
if (Mix.inProduction) {
plugins.push(
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
]
}, Mix.browserSync),
{
reload: false
}
)
);
}
if (Mix.notifications) {
module.exports.plugins.push(
new plugins.WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: true,
contentImage: Mix.Paths.root('node_modules/laravel-mix/icons/laravel.png')
})
);
}
if (Mix.copy) {
Mix.copy.forEach(copy => {
module.exports.plugins.push(
new plugins.CopyWebpackPlugin([copy])
);
});
}
if (Mix.extract) {
module.exports.plugins.push(
Mix.initialize();
/*
|--------------------------------------------------------------------------
| Webpack Context
|--------------------------------------------------------------------------
|
| This prop will determine the appropriate context, when running Webpack.
| Since you have the option of publishing this webpack.config.js file
| to your project root, we will dynamically set the path for you.
|
*/
module.exports.context = Mix.Paths.root();
/*
|--------------------------------------------------------------------------
| Webpack Entry
|--------------------------------------------------------------------------
|
| We'll first specify the entry point for Webpack. By default, we'll
| assume a single bundled file, but you may call Mix.extract()
| to make a separate bundle specifically for vendor libraries.
|
*/
module.exports.entry = Mix.entry().get();
postcss: [
require('autoprefixer')
],
context: __dirname,
output: { path: './' }
}
})
]);
if (Mix.notifications) {
module.exports.plugins.push(
new plugins.WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: true,
contentImage: Mix.Paths.root('node_modules/laravel-mix/icons/laravel.png')
})
);
}
module.exports.plugins.push(
new plugins.WebpackOnBuildPlugin(
stats => Mix.events.fire('build', stats)
)
);
if (Mix.copy) {
Mix.copy.forEach(copy => {
module.exports.plugins.push(
new plugins.CopyWebpackPlugin([copy])
postcss: [
require('autoprefixer')
],
context: __dirname,
output: { path: './' }
}
})
]);
if (Mix.notifications) {
module.exports.plugins.push(
new plugins.WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: true,
contentImage: Mix.Paths.root('node_modules/laravel-mix/icons/laravel.png')
})
);
}
module.exports.plugins.push(
new plugins.WebpackOnBuildPlugin(
stats => Mix.events.fire('build', stats)
)
);
if (Mix.copy) {
Mix.copy.forEach(copy => {
module.exports.plugins.push(
new plugins.CopyWebpackPlugin([copy])
let Mix = require('laravel-mix').config;
let webpackPlugins = require('laravel-mix').plugins;
let dotenv = require('dotenv')
/*
|--------------------------------------------------------------------------
| Load Environment Variables
|--------------------------------------------------------------------------
|
| Load environment variables from .env file. dotenv will never modify
| any environment variables that have already been set.
|
*/
dotenv.config({
path: Mix.Paths.root('.env')
});
/*
|--------------------------------------------------------------------------
| Mix Initialization
|--------------------------------------------------------------------------
|
| As our first step, we'll require the project's Laravel Mix file
| and record the user's requested compilation and build steps.
| Once those steps have been recorded, we may get to work.
|
*/
Mix.initialize();
postcss: [
require('autoprefixer')
],
context: __dirname,
output: { path: './' }
}
})
]);
if (Mix.notifications) {
module.exports.plugins.push(
new plugins.WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: true,
contentImage: Mix.Paths.root('node_modules/laravel-mix/icons/laravel.png')
})
);
}
module.exports.plugins.push(
new plugins.WebpackOnBuildPlugin(
stats => Mix.events.fire('build', stats)
)
);
if (Mix.copy) {
Mix.copy.forEach(copy => {
module.exports.plugins.push(
new plugins.CopyWebpackPlugin([copy])
Mix.initialize();
/*
|--------------------------------------------------------------------------
| Webpack Context
|--------------------------------------------------------------------------
|
| This prop will determine the appropriate context, when running Webpack.
| Since you have the option of publishing this webpack.config.js file
| to your project root, we will dynamically set the path for you.
|
*/
module.exports.context = Mix.Paths.root();
/*
|--------------------------------------------------------------------------
| Webpack Entry
|--------------------------------------------------------------------------
|
| We'll first specify the entry point for Webpack. By default, we'll
| assume a single bundled file, but you may call Mix.extract()
| to make a separate bundle specifically for vendor libraries.
|
*/
module.exports.entry = Mix.entry();