ember-auto-import
ember-auto-import copied to clipboard
wrong assets url if rootUrl is set to empty string ''
because ensureTrailingSlash for rootUrl will return a "/" and will end up adding a leading slash to the full url
this is supported on ember-cli https://github.com/ember-cli/ember-cli/pull/6182
can't deploy app to github-pages or elsewhere where relative path is needed without a leading '/'
I'm running into the same issue. Tried setting publicAssetURL
to an empty string as well. But it did not help.
I don't know the deployment location at build time. So I need to use a relative URL. Configured Ember's router to use hash location strategy. So no need for absolute URL. Just need to figure out how to configure Ember Auto Import / Webpack to use relative URLs for assets as well.
Just figured out that it's working if setting publicAssetURL
to assets/
.
diff --git a/website/ember-cli-build.js b/website/ember-cli-build.js
index 9b5e85d..978f723 100644
--- a/website/ember-cli-build.js
+++ b/website/ember-cli-build.js
@@ -4,6 +4,9 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
+ autoImport: {
+ publicAssetURL: 'assets/',
+ },
'ember-bootstrap': {
whitelist: ['bs-navbar', 'bs-collapse'],
},
Just figured out that it's working if setting
publicAssetURL
toassets/
.diff --git a/website/ember-cli-build.js b/website/ember-cli-build.js index 9b5e85d..978f723 100644 --- a/website/ember-cli-build.js +++ b/website/ember-cli-build.js @@ -4,6 +4,9 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function (defaults) { let app = new EmberApp(defaults, { + autoImport: { + publicAssetURL: 'assets/', + }, 'ember-bootstrap': { whitelist: ['bs-navbar', 'bs-collapse'], },
This is not working if running ember test
. :sob:
That's right. But in tests it looks to work without setting the public asset url. So i wrapped it in an if env !== test