PostCSS dir-dependency (file 2): this should be grey too
++ PostCSS dir-dependency (file 3): this should be grey too +
URL separation preservation: should have valid background-image diff --git a/playground/css/postcss-caching/css.spec.ts b/playground/css/postcss-caching/css.spec.ts index bbffdb618280e4..45e8aadaa5489c 100644 --- a/playground/css/postcss-caching/css.spec.ts +++ b/playground/css/postcss-caching/css.spec.ts @@ -36,7 +36,7 @@ test('postcss config', async () => { blueApp = null greenApp = await startServer(greenAppDir) - await page.goto(`http://localhost:${port}`) + await page.reload() // hmr reloads it automatically but reload here for consistency const greenA = await page.$('.postcss-a') expect(await getColor(greenA)).toBe('black') const greenB = await page.$('.postcss-b') diff --git a/playground/css/postcss.config.js b/playground/css/postcss.config.js index 33058023541515..b30209bff42097 100644 --- a/playground/css/postcss.config.js +++ b/playground/css/postcss.config.js @@ -16,7 +16,7 @@ function testDirDep() { AtRule(atRule, { result, Comment }) { if (atRule.name === 'test') { const pattern = normalizePath( - path.resolve(path.dirname(result.opts.from), './glob-dep/*.css') + path.resolve(path.dirname(result.opts.from), './glob-dep/**/*.css') ) const files = glob.sync(pattern) const text = files.map((f) => fs.readFileSync(f, 'utf-8')).join('\n') @@ -30,6 +30,14 @@ function testDirDep() { glob: '*.css', parent: result.opts.from }) + + result.messages.push({ + type: 'dir-dependency', + plugin: 'dir-dep', + dir: './glob-dep/nested (dir)', // includes special characters in glob + glob: '*.css', + parent: result.opts.from + }) } } } diff --git a/playground/define/__tests__/define.spec.ts b/playground/define/__tests__/define.spec.ts index 695d210a822ed6..76b1dfef5feb39 100644 --- a/playground/define/__tests__/define.spec.ts +++ b/playground/define/__tests__/define.spec.ts @@ -40,4 +40,7 @@ test('string', async () => { // html would't need to define replacement expect(await page.textContent('.exp-define')).toBe('__EXP__') expect(await page.textContent('.import-json')).toBe('__EXP__') + expect(await page.textContent('.define-in-dep')).toBe( + defines.__STRINGIFIED_OBJ__ + ) }) diff --git a/playground/define/commonjs-dep/index.js b/playground/define/commonjs-dep/index.js new file mode 100644 index 00000000000000..23e0bf1b32e32f --- /dev/null +++ b/playground/define/commonjs-dep/index.js @@ -0,0 +1 @@ +module.exports = { defined: __STRINGIFIED_OBJ__ } diff --git a/playground/define/commonjs-dep/package.json b/playground/define/commonjs-dep/package.json new file mode 100644 index 00000000000000..3047ae68c9f75a --- /dev/null +++ b/playground/define/commonjs-dep/package.json @@ -0,0 +1,6 @@ +{ + "name": "commonjs-dep", + "private": true, + "version": "1.0.0", + "type": "commonjs" +} diff --git a/playground/define/index.html b/playground/define/index.html index 1260b119149d28..c4f4c598aba563 100644 --- a/playground/define/index.html +++ b/playground/define/index.html @@ -16,6 +16,7 @@
no identifier substring:
define variable in html: __EXP__
import json:
define in dep: