Merge pull request #9823 from overleaf/em-webpack-shared-libs

Fix webpack reloading for shared libraries in the monorepo

GitOrigin-RevId: 498606c662a70fb6c0fc6a2f627116ea9ab28b33
This commit is contained in:
Eric Mc Sween 2022-10-05 08:16:50 -04:00 committed by Copybot
parent 37c69ec830
commit 26d8c087ee

View file

@ -59,6 +59,7 @@ const aceDir = getModuleDirectory('ace-builds')
const pdfjsVersions = ['pdfjs-dist210', 'pdfjs-dist213']
const vendorDir = path.join(__dirname, 'frontend/js/vendor')
const librariesDir = path.resolve(__dirname, '../../libraries')
module.exports = {
// Defines the "entry point(s)" for the application - i.e. the file which
@ -88,10 +89,10 @@ module.exports = {
rules: [
{
// Pass application JS/TS files through babel-loader, compiling to ES5
test: /\.[j|t]sx?$/,
test: /\.[jt]sx?$/,
// Only compile application files (npm and vendored dependencies are in
// ES5 already)
exclude: [/node_modules\/(?!react-dnd\/)/, vendorDir],
exclude: [/node_modules\/(?!react-dnd\/)/, vendorDir, librariesDir],
use: [
{
loader: 'babel-loader',
@ -217,7 +218,6 @@ module.exports = {
`frontend/js/vendor/libs/${PackageVersions.lib('fineuploader')}`
),
},
symlinks: false,
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
fallback: {
events: require.resolve('events'),