From c2c7a06749eba7235a459e7ee05611dc986b2517 Mon Sep 17 00:00:00 2001 From: Jacob Bare Date: Tue, 12 Oct 2021 10:46:25 -0500 Subject: [PATCH] Fix webpack builds by disabling fully specified files See - https://webpack.js.org/configuration/module/#resolvefullyspecified - https://github.com/graphql/graphql-js/issues/2721#issuecomment-929956042 - https://github.com/apollographql/apollo-client/issues/8861#issuecomment-929949542 --- packages/web-cli/src/gulp/js.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/web-cli/src/gulp/js.js b/packages/web-cli/src/gulp/js.js index 6b7af5834..edb3f9cc5 100644 --- a/packages/web-cli/src/gulp/js.js +++ b/packages/web-cli/src/gulp/js.js @@ -51,13 +51,23 @@ module.exports = cwd => (cb) => { }, module: { rules: [ + { + test: /\.m?js/, + resolve: { + fullySpecified: false, + }, + }, { test: /\.vue$/, loader: require.resolve('vue-loader'), }, { - test: /\.m?js$/, + test: /\.js$/, loader: require.resolve('babel-loader'), + exclude: file => ( + /node_modules\/(?!@parameter1\/base-cms-marko-web.*?\/browser)/.test(file) + && !/\.vue\.js/.test(file) + ), options: { presets: [ [ @@ -74,7 +84,6 @@ module.exports = cwd => (cb) => { useBuiltIns: 'usage', corejs: '3.18', debug: false, - modules: 'cjs', }, ], ],