Menu icon Foundation
Require is not defined (single page js)

In config.yml 

entries:
    - "src/assets/js/app.js"
    - "!src/assets/js/single_page/overons.js"

In default.html

{{#ifpage 'overons'}}
      <script src="{{root}}assets/js/single_page/overons.js"></script>
{{/ifpage}}

In overons.js 

const ScrollReveal = require(`scrollreveal`);

window.sr = ScrollReveal({
  reset: true,
  viewFactor: 0.4,
  mobile: false,
  // easing: `linear`,
   easing: `cubic-bezier(0,.7,.1,1)`
});

$(document).foundation();

I get an error that require is not defined. Pls help!

 

js require not defined single page js gulp page specific

In config.yml 

entries:
    - "src/assets/js/app.js"
    - "!src/assets/js/single_page/overons.js"

In default.html

{{#ifpage 'overons'}}
      <script src="{{root}}assets/js/single_page/overons.js"></script>
{{/ifpage}}

In overons.js 

const ScrollReveal = require(`scrollreveal`);

window.sr = ScrollReveal({
  reset: true,
  viewFactor: 0.4,
  mobile: false,
  // easing: `linear`,
   easing: `cubic-bezier(0,.7,.1,1)`
});

$(document).foundation();

I get an error that require is not defined. Pls help!

 

Niall Horan over 1 year ago

ummm........... Even i am facing the same issue and looking for help. 

 

 

OPC Registration Cost