2020-01-01 13:55:28 +05:30
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const vendorDllHash = require('./helpers/vendor_dll_hash');
|
2020-03-09 13:42:32 +05:30
|
|
|
const { YarnCheck } = require('yarn-check-webpack-plugin');
|
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'],
|
|
|
|
},
|
|
|
|
|
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: [
|
|
|
|
'jquery',
|
|
|
|
'pdfjs-dist/build/pdf',
|
|
|
|
'pdfjs-dist/build/pdf.worker.min',
|
|
|
|
'sql.js',
|
|
|
|
'core-js',
|
|
|
|
'echarts',
|
|
|
|
'lodash',
|
|
|
|
'underscore',
|
|
|
|
'vuex',
|
|
|
|
'pikaday',
|
|
|
|
'vue/dist/vue.esm.js',
|
2020-03-09 13:42:32 +05:30
|
|
|
'@gitlab/at.js',
|
2020-01-01 13:55:28 +05:30
|
|
|
'jed',
|
|
|
|
'mermaid',
|
|
|
|
'katex',
|
|
|
|
'three',
|
|
|
|
'select2',
|
|
|
|
'moment',
|
|
|
|
'aws-sdk',
|
|
|
|
'sanitize-html',
|
|
|
|
'bootstrap/dist/js/bootstrap.js',
|
|
|
|
'sortablejs/modular/sortable.esm.js',
|
|
|
|
'popper.js',
|
|
|
|
'apollo-client',
|
|
|
|
'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-09 13:42:32 +05:30
|
|
|
new YarnCheck({
|
|
|
|
rootDirectory: ROOT_PATH,
|
|
|
|
exclude: /ts-jest/,
|
|
|
|
forceKill: true,
|
|
|
|
}),
|
2020-01-01 13:55:28 +05:30
|
|
|
],
|
|
|
|
|
|
|
|
node: {
|
|
|
|
fs: 'empty', // sqljs requires fs
|
|
|
|
setImmediate: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
devtool: 'cheap-module-source-map',
|
|
|
|
};
|