Commit 90295540 authored by Lukas Eipert's avatar Lukas Eipert Committed by Mike Greiling

Move to jquery slim

parent a6d5966a
......@@ -121,6 +121,7 @@ const alias = {
images: path.join(ROOT_PATH, 'app/assets/images'),
vendor: path.join(ROOT_PATH, 'vendor/assets/javascripts'),
vue$: 'vue/dist/vue.esm.js',
jquery$: 'jquery/dist/jquery.slim.js',
spec: path.join(ROOT_PATH, 'spec/javascripts'),
jest: path.join(ROOT_PATH, 'spec/frontend'),
shared_queries: path.join(ROOT_PATH, 'app/graphql/queries'),
......
......@@ -13,6 +13,9 @@ module.exports = {
mode: 'development',
resolve: {
extensions: ['.js'],
alias: {
jquery$: 'jquery/dist/jquery.slim.js',
},
},
// ensure output is not generated when errors are encountered
......@@ -22,7 +25,7 @@ module.exports = {
entry: {
vendor: [
'jquery',
'jquery/dist/jquery.slim.js',
'pdfjs-dist/build/pdf',
'pdfjs-dist/build/pdf.worker.min',
'sql.js',
......
......@@ -50,6 +50,7 @@ module.exports = (path, options = {}) => {
'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json',
'^spec/test_constants$': '<rootDir>/spec/frontend/__helpers__/test_constants',
'^jest/(.*)$': '<rootDir>/spec/frontend/$1',
'^jquery$': '<rootDir>/node_modules/jquery/dist/jquery.slim.js',
...extModuleNameMapper,
};
......
......@@ -33,7 +33,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(function (root, factory) {
if (typeof module !== 'undefined' && module.exports) {
factory(root, root.jasmine, require('jquery'));
// The line below is patched from jquery => jquery/dist/jquery
// in order to load a jQuery with ajax, so that this testing library
// doesn't break
factory(root, root.jasmine, require('jquery/dist/jquery'));
} else {
factory(root, root.jasmine, root.jQuery);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment