Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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.copy) {
Mix.copy.forEach(copy => {
plugins.push(
new webpackPlugins.CopyWebpackPlugin([copy])
);
});
}
if (Mix.entry().hasExtractions()) {
plugins.push(
new webpack.optimize.CommonsChunkPlugin({
names: Mix.entry().getExtractions(),
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.
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.
*/
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();
/*
|--------------------------------------------------------------------------
| Webpack Output
|--------------------------------------------------------------------------
|
| Webpack naturally requires us to specify our desired output path and
| file name. We'll simply echo what you passed to with Mix.js().
| Note that, for Mix.version(), we'll properly hash the file.
|
*/
module.exports.output = Mix.output();
/*
|--------------------------------------------------------------------------
plugins.push(
new webpack.DefinePlugin(
Mix.definitions({
NODE_ENV: Mix.inProduction
? 'production'
: ( process.env.NODE_ENV || 'development' )
})
),
new webpackPlugins.WebpackOnBuildPlugin(
stats => global.events.fire('build', stats)
)
);
if (! Mix.entry().hasScripts()) {
plugins.push(new webpackPlugins.MockEntryPlugin(Mix.output().path));
}
module.exports.plugins = plugins;
/*
|--------------------------------------------------------------------------
| Mix Finalizing
|--------------------------------------------------------------------------
|
| Now that we've declared the entirety of our Webpack configuration, the
| final step is to scan for any custom configuration in the Mix file.
| If mix.webpackConfig() is called, we'll merge it in, and build!
|
if (Mix.options.notifications) {
plugins.push(
new webpackPlugins.WebpackNotifierPlugin({
title: 'Laravel Mix',
alwaysNotify: true,
contentImage: Mix.Paths.root('node_modules/laravel-mix/icons/laravel.png')
})
);
}
if (Mix.copy.length) {
new webpackPlugins.CopyWebpackPlugin(Mix.copy);
}
if (Mix.entry().hasExtractions()) {
plugins.push(
new webpack.optimize.CommonsChunkPlugin({
names: Mix.entry().getExtractions(),
minChunks: Infinity
})
);
}
if (Mix.options.versioning) {
plugins.push(
new webpack[Mix.inProduction ? 'HashedModuleIdsPlugin': 'NamedModulesPlugin'](),
new webpackPlugins.WebpackChunkHashPlugin()
);
} else if (Mix.options.hmr) {
plugins.push(
new webpack.NamedModulesPlugin()
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();
/*
|--------------------------------------------------------------------------
| Webpack Output
|--------------------------------------------------------------------------
|
| Webpack naturally requires us to specify our desired output path and
| file name. We'll simply echo what you passed to with Mix.js().
| Note that, for Mix.version(), we'll properly hash the file.
|
*/
module.exports.output = Mix.output();
plugins.push(
new webpack.DefinePlugin(
Mix.definitions({
NODE_ENV : Mix.inProduction
? 'production'
: ( process.env.NODE_ENV || 'development' )
})
),
new webpackPlugins.WebpackOnBuildPlugin(
stats => global.events.fire('build', stats)
)
);
if (!Mix.entry().hasScripts()) {
plugins.push(new webpackPlugins.MockEntryPlugin(Mix.output().path));
}
module.exports.plugins = plugins;
/*
|--------------------------------------------------------------------------
| Mix Finalizing
|--------------------------------------------------------------------------
|
| Now that we've declared the entirety of our Webpack configuration, the
| final step is to scan for any custom configuration in the Mix file.
| If mix.webpackConfig() is called, we'll merge it in, and build!
|
*/
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();
/*
|--------------------------------------------------------------------------
| Webpack Output
|--------------------------------------------------------------------------
|
| Webpack naturally requires us to specify our desired output path and
| file name. We'll simply echo what you passed to with Mix.js().
| Note that, for Mix.version(), we'll properly hash the file.
|
*/
module.exports.output = Mix.output();