debian-mirror-gitlab/config/webpack.vendor.config.js

92 lines
2.2 KiB
JavaScript
Raw Normal View History

2020-01-01 13:55:28 +05:30
const path = require('path');
const webpack = require('webpack');
2020-03-13 15:44:24 +05:30
const { YarnCheck } = require('yarn-check-webpack-plugin');
2021-04-17 20:07:23 +05:30
const vendorDllHash = require('./helpers/vendor_dll_hash');
2020-01-01 13:55:28 +05:30
const ROOT_PATH = path.resolve(__dirname, '..');
const dllHash = vendorDllHash();
const dllCachePath = path.join(ROOT_PATH, `tmp/cache/webpack-dlls/${dllHash}`);
const dllPublicPath = `/assets/webpack/dll.${dllHash}/`;
module.exports = {
mode: 'development',
resolve: {
extensions: ['.js'],
2021-04-29 21:17:54 +05:30
alias: {
jquery$: 'jquery/dist/jquery.slim.js',
},
2020-01-01 13:55:28 +05:30
},
2020-04-08 14:13:33 +05:30
// ensure output is not generated when errors are encountered
bail: true,
2020-01-01 13:55:28 +05:30
context: ROOT_PATH,
entry: {
vendor: [
2023-06-20 00:43:36 +05:30
'@apollo/client/core',
'@gitlab/at.js',
2020-01-01 13:55:28 +05:30
'core-js',
2023-06-20 00:43:36 +05:30
'dexie',
'dompurify',
2020-01-01 13:55:28 +05:30
'echarts',
'jed',
2023-06-20 00:43:36 +05:30
'jquery/dist/jquery.slim.js',
2020-01-01 13:55:28 +05:30
'katex',
2023-06-20 00:43:36 +05:30
'lodash',
'mousetrap',
'pikaday',
2020-01-01 13:55:28 +05:30
'popper.js',
2023-06-20 00:43:36 +05:30
'sortablejs/modular/sortable.esm.js',
2020-01-01 13:55:28 +05:30
'source-map',
2023-06-20 00:43:36 +05:30
'three',
'vue',
'vuex',
2020-01-01 13:55:28 +05:30
],
},
output: {
path: dllCachePath,
publicPath: dllPublicPath,
filename: '[name].dll.bundle.js',
chunkFilename: '[name].dll.chunk.js',
library: '[name]_[hash]',
},
plugins: [
new webpack.DllPlugin({
path: path.join(dllCachePath, '[name].dll.manifest.json'),
name: '[name]_[hash]',
}),
2020-03-13 15:44:24 +05:30
new YarnCheck({
rootDirectory: ROOT_PATH,
2020-06-23 00:09:42 +05:30
exclude: new RegExp(
[
/*
chokidar has a newer version which do not depend on fsevents,
is faster and only compatible with newer node versions (>=8)
Their actual interface remains the same and we can safely _force_
newer versions to get performance and security benefits.
This can be removed once all dependencies are up to date:
https://gitlab.com/gitlab-org/gitlab/-/issues/219353
*/
'chokidar',
// We are ignoring ts-jest, because we force a newer version, compatible with our current jest version
'ts-jest',
].join('|'),
),
2020-03-13 15:44:24 +05:30
forceKill: true,
}),
2020-01-01 13:55:28 +05:30
],
node: {
fs: 'empty', // sqljs requires fs
setImmediate: false,
},
devtool: 'cheap-module-source-map',
};