3

After removing the line "only": "gulpfile.babel.js", in the .babelrc file, I created a class:

export default class App {
  constructor() {
    console.log("Cool")
  }
}

Then, I imported it in the first line of the default main.js, and called it at the end:

import App from './app'
//...
(function() {
  'use strict';

  // default stuffs ...

  // Your custom JavaScript goes here

  const app = new App();

})();

It threw me this Uncaught ReferenceError: require is not defined(…), and the error point to the first line of the main.js where the statement import App from './app' is.

Cross posted here: https://github.com/google/web-starter-kit/issues/904

Downhillski
  • 2,555
  • 2
  • 27
  • 39

0 Answers0