Skip to content

Commit 0b5f3d7

Browse files
authored
feat: vite support for v2 (tailwind 3+) (#202)
1 parent a145afd commit 0b5f3d7

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+
constrequire=createRequire(import.meta.url);
3+
4+
letpostcssConfig="./postcss.config.js";
5+
6+
try{
7+
consttailwind=require("tailwindcss");
8+
constnsTailwind=require("@nativescript/tailwind");
9+
postcssConfig={plugins: [tailwind,nsTailwind]};
10+
}catch(err){
11+
console.warn(
12+
"Inline PostCSS unavailable, falling back to ./postcss.config.js"
13+
);
14+
}
15+
16+
exportdefault()=>{
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)