mobilizon.chapril.org-mobil.../js/vue.config.js
Thomas Citharel 93cecbe49c
Improve build times
* Fix bulma/buefy being imported many (many !!!) times

* Remove javascript-time-ago because date-fns pretty much does the same
thing

* Make sure languages are loaded asynchronously

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-10-14 09:46:33 +02:00

49 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const path = require("path");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
module.exports = {
runtimeCompiler: true,
lintOnSave: true,
filenameHashing: true,
productionSourceMap: false,
outputDir: path.resolve(__dirname, "../priv/static"),
configureWebpack: (config) => {
// Limit the used memory when building
// Source : https://stackoverflow.com/a/55810460/10204399
// get a reference to the existing ForkTsCheckerWebpackPlugin
const existingForkTsChecker = config.plugins.filter(
(p) => p instanceof ForkTsCheckerWebpackPlugin
)[0];
// remove the existing ForkTsCheckerWebpackPlugin
// so that we can replace it with our modified version
config.plugins = config.plugins.filter((p) => !(p instanceof ForkTsCheckerWebpackPlugin));
// copy the options from the original ForkTsCheckerWebpackPlugin
// instance and add the memoryLimit property
const forkTsCheckerOptions = existingForkTsChecker.options;
forkTsCheckerOptions.memoryLimit = process.env.NODE_BUILD_MEMORY || 2048;
config.plugins.push(new ForkTsCheckerWebpackPlugin(forkTsCheckerOptions));
},
chainWebpack: (config) => {
// remove the prefetch plugin
config.plugins.delete("prefetch");
},
css: {
loaderOptions: {
scss: {
additionalData: `@import "@/variables.scss";`,
},
},
},
// configureWebpack: {
// optimization: {
// splitChunks: {
// minSize: 10000,
// maxSize: 250000,
// },
// },
// },
};