Open yowari opened 6 years ago
I guess ./assets
as default would be ok too 🤔
Well, if you don't provide --base-href
option in ng build --prod
, /assets
will be used (default behaviour).
This, for example, can help to set npm script to build Angular app for gh-pages and prod (exemple: for Docker) easily without changing code. The other ways is to set env variable for assets path or as i do in my project, retrieve the base-href path used.
I already submitted a PR #64 . It not really a good solution but it works :confused:
I'm facing that problem too. Any walkaround?
OK, after i wrote that i read @yowari comment once again and i'll try that way. Thanks =)
Seems that ./assets
works too, like @bboehm86 suggested, though not sure why. I'm able to build for gh-pages by using the following import in AppModule
:
MonacoEditorModule.forRoot({baseUrl: "./assets"})
this doesn't work for me
Seems that
./assets
works too, like @bboehm86 suggested, though not sure why. I'm able to build for gh-pages by using the following import inAppModule
:MonacoEditorModule.forRoot({baseUrl: "./assets"})
This worked perfectly for me. It should be quoted in the Readme.md in my opinion
It's doesn't work for me too
it works fine for me, even with remote URL:
MonacoEditorModule.forRoot({
baseUrl: 'http://localhost:53015/assets'
})
ngx-monaco-editor does not take into account base-href option when building Angular app. For now, we have to configure baseUrl when importing the module. I think the component should be able to get the baseHref and use it as default path. Meaning, we should perhaps have by default
${baseHref}/assets
instead of/assets
. https://github.com/atularen/ngx-monaco-editor/blob/2ffca32ec03de436ef7ea2fa6d901eba7e638390/src/platform/editor/base-editor.ts#L40 To do so, we first have to inject the baseHref, which is not a simple thing to do 😛 (at least elegantly). My idea is to first extract a service from the BaseEditor class and then manage to inject the baseHref. What do you think? ps: For instance, I use a hacky way to do this behaviour without altering the code in my project https://github.com/yowari/code-challenger/blob/master/src/app/shared/shared.module.ts btw: first time trying to contribute to a GitHub project so please be kind :blush: