Follow-up from https://github.com/webrecorder/browsertrix-cloud/pull/1546#discussion_r1529001599 (cc @SuaYoo) - Adds `eslint-plugin-import-x` and `@ianvs/prettier-plugin-sort-imports` and configures rules for them both so imports get sorted on format & on lint. - Runs both on everything!
35 lines
737 B
JavaScript
35 lines
737 B
JavaScript
const TerserPlugin = require("terser-webpack-plugin");
|
|
const { merge } = require("webpack-merge");
|
|
|
|
const [main, vnc] = require("./webpack.config.js");
|
|
|
|
module.exports = [
|
|
merge(main, {
|
|
mode: "production",
|
|
devtool: "source-map",
|
|
|
|
// TODO figure out minifying lit templates
|
|
optimization: {
|
|
runtimeChunk: "single",
|
|
splitChunks: {
|
|
// Split both async and non-async chunks (only async by default)
|
|
chunks: "all",
|
|
},
|
|
minimize: true,
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: ["log", "info"],
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
}),
|
|
{
|
|
...vnc,
|
|
mode: "production",
|
|
},
|
|
];
|