I'm trying to add external js in my module which will be applicable on all pages on frontend. This is the process I've followed:
Code in my layout file
app/code/Lapisbard/General/view/frontend/layout/default.xml
Added js file at
app/code/Lapisbard/General/view/frontend/web/js/ro_allpage.js
with following codedefine('js/theme', [ 'jquery', 'domReady!' ], function ($) { 'use strict'; console.log('Hello'); }); I see my file is being added on the page but it throws console error Uncaught ReferenceError: define is not defined. What I'm doing wrong?
Also I tried code below which throws Uncaught ReferenceError: require is not definedrequire(["jquery"], function($){ console.log("hello"); });