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 = { ...@@ -121,6 +121,7 @@ const alias = {
images: path.join(ROOT_PATH, 'app/assets/images'), images: path.join(ROOT_PATH, 'app/assets/images'),
vendor: path.join(ROOT_PATH, 'vendor/assets/javascripts'), vendor: path.join(ROOT_PATH, 'vendor/assets/javascripts'),
vue$: 'vue/dist/vue.esm.js', vue$: 'vue/dist/vue.esm.js',
jquery$: 'jquery/dist/jquery.slim.js',
spec: path.join(ROOT_PATH, 'spec/javascripts'), spec: path.join(ROOT_PATH, 'spec/javascripts'),
jest: path.join(ROOT_PATH, 'spec/frontend'), jest: path.join(ROOT_PATH, 'spec/frontend'),
shared_queries: path.join(ROOT_PATH, 'app/graphql/queries'), shared_queries: path.join(ROOT_PATH, 'app/graphql/queries'),
......
...@@ -13,6 +13,9 @@ module.exports = { ...@@ -13,6 +13,9 @@ module.exports = {
mode: 'development', mode: 'development',
resolve: { resolve: {
extensions: ['.js'], extensions: ['.js'],
alias: {
jquery$: 'jquery/dist/jquery.slim.js',
},
}, },
// ensure output is not generated when errors are encountered // ensure output is not generated when errors are encountered
...@@ -22,7 +25,7 @@ module.exports = { ...@@ -22,7 +25,7 @@ module.exports = {
entry: { entry: {
vendor: [ vendor: [
'jquery', 'jquery/dist/jquery.slim.js',
'pdfjs-dist/build/pdf', 'pdfjs-dist/build/pdf',
'pdfjs-dist/build/pdf.worker.min', 'pdfjs-dist/build/pdf.worker.min',
'sql.js', 'sql.js',
......
...@@ -50,6 +50,7 @@ module.exports = (path, options = {}) => { ...@@ -50,6 +50,7 @@ module.exports = (path, options = {}) => {
'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json', 'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json',
'^spec/test_constants$': '<rootDir>/spec/frontend/__helpers__/test_constants', '^spec/test_constants$': '<rootDir>/spec/frontend/__helpers__/test_constants',
'^jest/(.*)$': '<rootDir>/spec/frontend/$1', '^jest/(.*)$': '<rootDir>/spec/frontend/$1',
'^jquery$': '<rootDir>/node_modules/jquery/dist/jquery.slim.js',
...extModuleNameMapper, ...extModuleNameMapper,
}; };
......
...@@ -33,7 +33,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ...@@ -33,7 +33,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(function (root, factory) { (function (root, factory) {
if (typeof module !== 'undefined' && module.exports) { 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 { } else {
factory(root, root.jasmine, root.jQuery); 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