mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update webpack config
This commit is contained in:
parent
26f92c93ce
commit
ded660b2c4
1 changed files with 30 additions and 24 deletions
54
webpack.mix.js
vendored
54
webpack.mix.js
vendored
|
@ -1,8 +1,10 @@
|
||||||
let mix = require('laravel-mix');
|
let mix = require('laravel-mix');
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
mix.before(() => {
|
mix.before(() => {
|
||||||
fs.rmSync('public/js', { recursive: true, force: true });
|
fs.rmSync('public/css', { recursive: true, force: true });
|
||||||
|
fs.rmSync('public/js', { recursive: true, force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,31 +48,35 @@ mix.version();
|
||||||
const TerserPlugin = require('terser-webpack-plugin');
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
|
|
||||||
mix.options({
|
mix.options({
|
||||||
processCssUrls: false,
|
processCssUrls: false,
|
||||||
terser: {
|
terser: {
|
||||||
parallel: true,
|
parallel: true,
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
compress: true,
|
compress: true,
|
||||||
output: {
|
output: {
|
||||||
comments: false
|
comments: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
mix.alias({
|
||||||
|
'@': path.join(__dirname, 'resources/assets/components'),
|
||||||
|
'~': path.join(__dirname, 'resources/assets/js/components'),
|
||||||
|
});
|
||||||
mix.webpackConfig({
|
mix.webpackConfig({
|
||||||
optimization: {
|
optimization: {
|
||||||
providedExports: false,
|
providedExports: false,
|
||||||
sideEffects: false,
|
sideEffects: false,
|
||||||
usedExports: false,
|
usedExports: false,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
minimizer: [ new TerserPlugin({
|
minimizer: [ new TerserPlugin({
|
||||||
extractComments: false,
|
extractComments: false,
|
||||||
})]
|
})]
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
chunkFilename: 'js/[name].[chunkhash].js',
|
chunkFilename: 'js/[name].[chunkhash].js',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mix.autoload({
|
mix.autoload({
|
||||||
jquery: ['$', 'jQuery', 'window.jQuery']
|
jquery: ['$', 'jQuery', 'window.jQuery']
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue