Skip to content

Commit 29c4ea7

Browse files
authored
feat: vite support (#201)
1 parent f26da45 commit 29c4ea7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

nativescript.vite.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { createRequire } from "module";
2+
const require = createRequire(import.meta.url);
3+
4+
let postcssConfig = "./postcss.config.js";
5+
6+
try {
7+
const twV4 = require("@tailwindcss/postcss");
8+
const nsTailwind = require("@nativescript/tailwind");
9+
postcssConfig = { plugins: [twV4, nsTailwind] };
10+
} catch (e2) {
11+
console.warn(
12+
"Inline PostCSS unavailable, falling back to ./postcss.config.js"
13+
);
14+
}
15+
16+
export default () => {
17+
return {
18+
css: {
19+
postcss: postcssConfig,
20+
},
21+
};
22+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "src/index.js",
66
"files": [
77
"src",
8+
"nativescript.vite.mjs",
89
"nativescript.webpack.js"
910
],
1011
"repository": "https://github.com/NativeScript/tailwind",

0 commit comments

Comments
 (0)