tmp date fix (oops)
This commit is contained in:
parent
2c24ff4fd5
commit
c6ad788020
@ -67,7 +67,12 @@ const postCSSPlugin = ({
|
|||||||
sourceRelDir = path.relative(path.dirname(rootDir), sourceDir),
|
sourceRelDir = path.relative(path.dirname(rootDir), sourceDir),
|
||||||
isModule = sourceBaseName.match(/\.module$/),
|
isModule = sourceBaseName.match(/\.module$/),
|
||||||
tmpDir = path.resolve(tmpDirPath, sourceRelDir),
|
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);
|
await ensureDir(tmpDir);
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ const autoprefixer = require("autoprefixer"),
|
|||||||
|
|
||||||
describe("PostCSS esbuild tests", () => {
|
describe("PostCSS esbuild tests", () => {
|
||||||
it("Works with basic CSS imports", (done) => {
|
it("Works with basic CSS imports", (done) => {
|
||||||
test("tests/basic.ts")
|
test(["tests/basic.ts"])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
assert(res);
|
assert(res);
|
||||||
done();
|
done();
|
||||||
@ -13,7 +13,7 @@ describe("PostCSS esbuild tests", () => {
|
|||||||
.catch(done);
|
.catch(done);
|
||||||
});
|
});
|
||||||
it("Works with preprocessors", (done) => {
|
it("Works with preprocessors", (done) => {
|
||||||
test("tests/preprocessors.ts")
|
test(["tests/preprocessors.ts"])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
assert(res);
|
assert(res);
|
||||||
done();
|
done();
|
||||||
@ -21,7 +21,7 @@ describe("PostCSS esbuild tests", () => {
|
|||||||
.catch(done);
|
.catch(done);
|
||||||
});
|
});
|
||||||
it("Works with CSS modules", (done) => {
|
it("Works with CSS modules", (done) => {
|
||||||
test("tests/modules.ts")
|
test(["tests/modules.ts"])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
assert(res);
|
assert(res);
|
||||||
done();
|
done();
|
||||||
@ -29,7 +29,7 @@ describe("PostCSS esbuild tests", () => {
|
|||||||
.catch(done);
|
.catch(done);
|
||||||
});
|
});
|
||||||
it("Works with CSS as entrypoint", (done) => {
|
it("Works with CSS as entrypoint", (done) => {
|
||||||
test("tests/styles.css")
|
test(["tests/styles.css", "tests/styles2.css"])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
assert(res);
|
assert(res);
|
||||||
done();
|
done();
|
||||||
@ -40,7 +40,7 @@ describe("PostCSS esbuild tests", () => {
|
|||||||
|
|
||||||
function test(entryPoint) {
|
function test(entryPoint) {
|
||||||
return build({
|
return build({
|
||||||
entryPoints: [entryPoint],
|
entryPoints: entryPoint,
|
||||||
bundle: true,
|
bundle: true,
|
||||||
outdir: "dist",
|
outdir: "dist",
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
6
test/tests/styles2.css
Normal file
6
test/tests/styles2.css
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.example {
|
||||||
|
display: grid;
|
||||||
|
transition: all 0.5s;
|
||||||
|
user-select: none;
|
||||||
|
background: linear-gradient(to bottom, white, black);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user