Skip to content

Commit

Permalink
fix missing vendor.css
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pircher <[email protected]>
  • Loading branch information
patricklx committed Nov 15, 2024
1 parent 730c4a1 commit 52a6da0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion doc-app/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { babel } from '@rollup/plugin-babel';
import { sassOptions } from './styles-support.js';
import { resolve } from 'path';
import { createRequire } from 'module';
import { ResolverLoader, virtualContent } from '@embroider/core';

const require = createRequire(import.meta.url);

Expand Down Expand Up @@ -41,7 +42,7 @@ let aliasPlugin = {
};

let docsUrl = process.env.ADDON_DOCS_VERSION_PATH;
if (!docsUrl.endsWith('/')) {
if (docsUrl && !docsUrl.endsWith('/')) {
docsUrl += '/';
}

Expand All @@ -66,6 +67,23 @@ export default defineConfig(({ mode }) => {
assets(),
contentFor(),
hmr(),
{
buildEnd() {
// workaround https://github.com/embroider-build/embroider/pull/2163
const resolverLoader = new ResolverLoader(process.cwd());
this.emitFile({
type: 'asset',
fileName: '@embroider/virtual/vendor.css',
source: virtualContent(
resolve(
resolverLoader.resolver.options.engines[0].root,
'-embroider-vendor-styles.css',
),
resolverLoader.resolver,
).src,
});
},
},

babel({
babelHelpers: 'runtime',
Expand Down

0 comments on commit 52a6da0

Please sign in to comment.