2019-12-17 04:07:48 -05:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2020-02-16 22:09:00 -05:00
|
|
|
const { YarnCheck } = require('yarn-check-webpack-plugin');
|
2021-03-10 10:09:11 -05:00
|
|
|
const vendorDllHash = require('./helpers/vendor_dll_hash');
|
2019-12-17 04:07:48 -05:00
|
|
|
|
|
|
|
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-03-23 20:09:26 -04:00
|
|
|
alias: {
|
|
|
|
jquery$: 'jquery/dist/jquery.slim.js',
|
|
|
|
},
|
2019-12-17 04:07:48 -05:00
|
|
|
},
|
|
|
|
|
2020-02-18 16:09:11 -05:00
|
|
|
// ensure output is not generated when errors are encountered
|
|
|
|
bail: true,
|
|
|
|
|
2019-12-17 04:07:48 -05:00
|
|
|
context: ROOT_PATH,
|
|
|
|
|
|
|
|
entry: {
|
|
|
|
vendor: [
|
2021-03-23 20:09:26 -04:00
|
|
|
'jquery/dist/jquery.slim.js',
|
2019-12-17 04:07:48 -05:00
|
|
|
'pdfjs-dist/build/pdf',
|
|
|
|
'pdfjs-dist/build/pdf.worker.min',
|
|
|
|
'core-js',
|
|
|
|
'echarts',
|
|
|
|
'lodash',
|
|
|
|
'vuex',
|
2021-09-10 17:11:04 -04:00
|
|
|
'vue',
|
2019-12-17 04:07:48 -05:00
|
|
|
'pikaday',
|
2020-02-14 04:08:43 -05:00
|
|
|
'@gitlab/at.js',
|
2019-12-17 04:07:48 -05:00
|
|
|
'jed',
|
|
|
|
'mermaid',
|
|
|
|
'katex',
|
|
|
|
'three',
|
|
|
|
'select2',
|
2020-05-28 17:08:22 -04:00
|
|
|
'moment-mini',
|
2020-08-13 14:10:36 -04:00
|
|
|
'dompurify',
|
2019-12-17 04:07:48 -05:00
|
|
|
'bootstrap/dist/js/bootstrap.js',
|
|
|
|
'sortablejs/modular/sortable.esm.js',
|
|
|
|
'popper.js',
|
2022-02-14 07:14:02 -05:00
|
|
|
'@apollo/client/core',
|
2019-12-17 04:07:48 -05:00
|
|
|
'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-02-16 22:09:00 -05:00
|
|
|
new YarnCheck({
|
|
|
|
rootDirectory: ROOT_PATH,
|
2020-06-01 17:08:09 -04:00
|
|
|
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-02-16 22:09:00 -05:00
|
|
|
forceKill: true,
|
|
|
|
}),
|
2019-12-17 04:07:48 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
node: {
|
|
|
|
fs: 'empty', // sqljs requires fs
|
|
|
|
setImmediate: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
devtool: 'cheap-module-source-map',
|
|
|
|
};
|