Skip to content

Commit

Permalink
test: skip checking for css in vite build
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 26, 2022
1 parent 9ee6956 commit fcf636d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vite/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export async function generateBuildManifest (ctx: ViteBuildContext) {
'var appConfig = window && window.__NUXT__ && window.__NUXT__.config.app || {}',
'var publicBase = appConfig.cdnURL || appConfig.baseURL || "/"',
'function joinURL (a, b) { return a[a.length -1] !== "/" ? a + "/" + b : a + b }',
'globalThis.__publicAssetsURL = function(id) { return joinURL(publicBase, id) }',
'globalThis.__buildAssetsURL = function(id) { return joinURL(publicBase, joinURL(appConfig.buildAssetsDir, id)) }',
'globalThis.__publicAssetsURL = function(id) { return joinURL(publicBase, id || "") }',
'globalThis.__buildAssetsURL = function(id) { return joinURL(publicBase, joinURL(appConfig.buildAssetsDir, id || "")) }',
`var imports = ${JSON.stringify([...clientImports])};`,
'imports.reduce(function(p, id){return p.then(function(){return System.import(__buildAssetsURL(id).slice(1))})}, Promise.resolve())'
].join('\n')
Expand Down
3 changes: 2 additions & 1 deletion test/bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ describe('dynamic paths', () => {
await expectNoClientErrors('/assets')
})

it('adds relative paths to CSS', async () => {
// Vite legacy build does not emit CSS files
it.skipIf(!process.env.TEST_WITH_WEBPACK)('adds relative paths to CSS', async () => {
const html = await $fetch('/assets')
const urls = Array.from(html.matchAll(/(href|src)="(.*?)"/g)).map(m => m[2])
const cssURL = urls.find(u => /_nuxt\/assets.*\.css$/.test(u))
Expand Down

0 comments on commit fcf636d

Please sign in to comment.