Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will denon config file support import from import_map.json? #72

Open
hylerrix opened this issue Jul 11, 2020 · 2 comments
Open

Will denon config file support import from import_map.json? #72

hylerrix opened this issue Jul 11, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@hylerrix
Copy link

hylerrix commented Jul 11, 2020

Is your feature request related to a problem? Please describe.

Hi, issues again. After I set importmap: 'import_map.json' in deno.config.ts, it worked well to load package from import_maps.json.

But base on the idea: use import_map as much as possible, I tried to code like this:

It got error above, what can I do?

Describe the solution you'd like

Support like this in denon.config.ts:

import { DenonConfig } from "denon"
import { config as env } from "dotenv"
@hylerrix hylerrix added the enhancement New feature or request label Jul 11, 2020
@eliassjogreen
Copy link
Member

I am unsure how this would be done unless you would do a first pass checking for only the import map configuration before running the configuration file as a whole. This would however make it so the import map would be static and only accept string literals (unless you do some serious analysis of the code before running).

@vintprox
Copy link

vintprox commented Nov 26, 2020

It's nice to have all project dependencies listed in import map. (Maybe?)

However, import map is more appropriate for dependencies that are repetitive, don't take part in initial bootstrapping and are more closer to application's code than to configuration. For example, if I want to comply with 12-Factor App methodology and load .env, it's simple as:

import { DenonConfig } from "https://deno.land/x/denon@2.4.5/mod.ts";
import { config as configureEnv } from "https://deno.land/x/dotenv@v1.0.1/mod.ts";

const env = configureEnv({
  safe: true,
});

const config: DenonConfig = {
  env,
  importmap: "import_map.json",
  tsconfig: "tsconfig.json",
  unstable: true,
  log: env.LOG_LEVEL,
  scripts: {
    ...
  },
};

export default config;

So everything that's more closer to the source part (and not configuration), relies within import_map.json, but initial configuration remains where it should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants