Skip to content

Commit

Permalink
tailwind SCSS test
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Dec 14, 2021
1 parent b3b56e6 commit 009577f
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 50 deletions.
2 changes: 2 additions & 0 deletions packages/core/integration-tests/package.json
Expand Up @@ -12,6 +12,7 @@
"test-ci": "yarn test --reporter mocha-multi-reporters --reporter-options configFile=./test/mochareporters.json"
},
"devDependencies": {
"autoprefixer": "^10.4.0",
"@babel/core": "^7.12.0",
"@babel/plugin-syntax-class-properties": "^7.12.1",
"@babel/plugin-syntax-export-default-from": "^7.2.0",
Expand Down Expand Up @@ -52,6 +53,7 @@
"react-dom": "^16.11.0",
"rimraf": "^2.6.1",
"sugarss": "^3.0.3",
"tailwindcss": "^3.0.2",
"tempy": "^0.3.0",
"ws": "^7.0.0"
}
Expand Down
@@ -0,0 +1,7 @@
const path = require("path");

module.exports = {
plugins: [
require('tailwindcss')(path.resolve(__dirname, "tailwind.config.js")),
]
}
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="stylesheet" href="index.scss">
</head>
<body class="p-2">
test
</body>
</html>
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
@apply p-4 m-4;
}
@@ -0,0 +1,3 @@
{

}
@@ -0,0 +1,7 @@
module.exports = {
content: ["index.html"],
theme: {
extend: {},
},
plugins: [],
}
Empty file.
17 changes: 17 additions & 0 deletions packages/core/integration-tests/test/tailwind.js
@@ -0,0 +1,17 @@
import assert from 'assert';
import path from 'path';
import {bundle, outputFS} from '@parcel/test-utils';

describe('tailwind', function () {
it('should support tailwind via SCSS', async function () {
let fixture = path.join(__dirname, '/integration/tailwind-scss');
let b = await bundle(path.join(fixture, 'index.html'));

let css = await outputFS.readFile(
b.getBundles().find(b => b.type === 'css'),
'utf8',
);
assert(css.includes('.p-2'));
assert(!css.includes('.m-2'));
});
});

0 comments on commit 009577f

Please sign in to comment.