tmp date fix (oops)

This commit is contained in:
g45t345rt 2021-03-23 19:43:05 -04:00
parent 2c24ff4fd5
commit c6ad788020
3 changed files with 17 additions and 6 deletions

View File

@ -67,7 +67,12 @@ const postCSSPlugin = ({
sourceRelDir = path.relative(path.dirname(rootDir), sourceDir),
isModule = sourceBaseName.match(/\.module$/),
tmpDir = path.resolve(tmpDirPath, sourceRelDir),
tmpFilePath = path.resolve(tmpDir, `${sourceBaseName}.css`);
tmpFilePath = path.resolve(
tmpDir,
`${sourceBaseName}-tmp-${Date.now()}-${sourceExt.replace(".", "")}${
isModule ? ".module" : ""
}.css`
);
await ensureDir(tmpDir);

View File

@ -5,7 +5,7 @@ const autoprefixer = require("autoprefixer"),
describe("PostCSS esbuild tests", () => {
it("Works with basic CSS imports", (done) => {
test("tests/basic.ts")
test(["tests/basic.ts"])
.then((res) => {
assert(res);
done();
@ -13,7 +13,7 @@ describe("PostCSS esbuild tests", () => {
.catch(done);
});
it("Works with preprocessors", (done) => {
test("tests/preprocessors.ts")
test(["tests/preprocessors.ts"])
.then((res) => {
assert(res);
done();
@ -21,7 +21,7 @@ describe("PostCSS esbuild tests", () => {
.catch(done);
});
it("Works with CSS modules", (done) => {
test("tests/modules.ts")
test(["tests/modules.ts"])
.then((res) => {
assert(res);
done();
@ -29,7 +29,7 @@ describe("PostCSS esbuild tests", () => {
.catch(done);
});
it("Works with CSS as entrypoint", (done) => {
test("tests/styles.css")
test(["tests/styles.css", "tests/styles2.css"])
.then((res) => {
assert(res);
done();
@ -40,7 +40,7 @@ describe("PostCSS esbuild tests", () => {
function test(entryPoint) {
return build({
entryPoints: [entryPoint],
entryPoints: entryPoint,
bundle: true,
outdir: "dist",
plugins: [

6
test/tests/styles2.css Normal file
View File

@ -0,0 +1,6 @@
.example {
display: grid;
transition: all 0.5s;
user-select: none;
background: linear-gradient(to bottom, white, black);
}