You need to import Base inside Derived
import {Base} './Base';
export class Derived extends Base {
}
I'm using mix with ES6 classes and modules, and am struggling with getting everything to work as if it were in a single (app.js) module.
From my webpack.mix.js, I'm calling... mix.js('resources/js/public/app.js', '/public/js/app.js') .version() .sourceMaps();
In resources/js/public/app.js, I've got, for a basic example, import (Base } from "./classes/Base", import { Derived } from "/classes/Derived";
The contents of Base is simply, export class Base {
}
The contents of Derived is simply, export class Derived extends Base {
}
Everything compiles fine, and in my main layout, I have
When I load the page, I get the following error: Uncaught ReferenceError: Base is not defined
I was under the impression, that since these two classes are in the same file, they will be in the same module, and I shouldn't have to import them. Am I wrong in this assumption?
Thanks in advance
You need to import Base inside Derived
import {Base} './Base';
export class Derived extends Base {
}
Please or to participate in this conversation.