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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
2.4 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: [
2021-04-29 21:17:54 +05:30
'jquery/dist/jquery.slim.js',
2020-01-01 13:55:28 +05:30
'core-js',
'echarts',
'lodash',
'vuex',
2021-11-11 11:23:49 +05:30
'vue',
2020-01-01 13:55:28 +05:30
'pikaday',
2020-03-13 15:44:24 +05:30
'@gitlab/at.js',
2020-01-01 13:55:28 +05:30
'jed',
'mermaid',
'katex',
'three',
2020-06-23 00:09:42 +05:30
'moment-mini',
2020-10-24 23:57:45 +05:30
'dompurify',
2020-01-01 13:55:28 +05:30
'bootstrap/dist/js/bootstrap.js',
'sortablejs/modular/sortable.esm.js',
'popper.js',
2022-04-04 11:22:00 +05:30
'@apollo/client/core',
2020-01-01 13:55:28 +05:30
'source-map',
'mousetrap',
],
},
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',
2022-11-25 23:54:43 +05:30
// We are ignoring esbuild as we want to force a newer version than what esbuild-loader provides
'esbuild',
2020-06-23 00:09:42 +05:30
// 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',
};