Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack - export const

Tags:

webpack

I'm trying out a migration from systemjs to webpack for the first time. In my app I had something like this:

import {appSettings} from "AppSettings";

Where AppSettings was just a file with a const, not actually a module:

    export const appSettings = {
        somethings: {
        }
    };

This works with systemjs, not with webpack. Anything I can do to fix that?

like image 499
user888734 Avatar asked Oct 16 '25 02:10

user888734


1 Answers

If you're trying to import one of your own modules you should use a relative path:

import {appSettings} from "./AppSettings";
like image 146
thitemple Avatar answered Oct 18 '25 22:10

thitemple



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!