Skip to content

implement dart-sass support #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ const renderDirectoryStructure = (module.exports.renderDirectoryStructure = asyn
case 'sass':
if (rawPath.slice(-5) == '.scss' || rawPath.slice(-5) == '.sass') files.push(rawPath);
break;
case 'dart-sass':
if (rawPath.slice(-5) == '.scss' || rawPath.slice(-5) == '.sass') files.push(rawPath);
break;
case 'less':
if (rawPath.slice(-5) == '.less') files.push(rawPath);
break;
Expand Down
22 changes: 4 additions & 18 deletions generator/templates/nvw/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style web lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style web lang="scss">
@import '~styles/style-one';

.w-page {
Expand All @@ -150,14 +143,7 @@
}

</style>
<%- rootOptions.cssPreprocessor
? `<style native lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<style native lang="scss">
@import '~styles/style-one';
</style>
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/components/HelloWorld.android.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/components/HelloWorld.ios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/components/HelloWorld.native.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
display: block;
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
@import '~styles/style-two';
@import '~styles/style-one';

Expand Down
13 changes: 3 additions & 10 deletions generator/templates/nvw/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
@import '~styles/style-one';
@import '~styles/style-two';

Expand Down
32 changes: 13 additions & 19 deletions generator/templates/simple/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
}

public goToAboutPage() {
VUE_APP_MODE == 'web' ? this.$router.push('about') : Vue.prototype.$navigateTo(About);
VUE_APP_MODE === 'web' ? this.$router.push('about') : Vue.prototype.$navigateTo(About);
}
<%_ } _%>
}
Expand All @@ -140,16 +140,18 @@

<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style web lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style web lang="scss">
@import '~styles/style-one';

.w-page {
height: 100%;
width: 100%;
}

</style>
<style native lang="scss">
@import '~styles/style-one';

.w-page {
Expand All @@ -158,14 +160,6 @@
}

</style>
<%- rootOptions.cssPreprocessor
? `<style native lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
@import '~styles/style-one';
</style>
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/components/HelloWorld.android.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/components/HelloWorld.ios.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/components/HelloWorld.native.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
}
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
.message {
color: #42b983;
display: block;
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
@import '~styles/style-two';
@import '~styles/style-one';
</style>
Expand Down
13 changes: 3 additions & 10 deletions generator/templates/simple/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,9 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style scoped lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style scoped lang="scss">
@import '~styles/style-one';
@import '~styles/style-two';

Expand Down
22 changes: 4 additions & 18 deletions generator/templates/vue-sfc-template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,11 @@
<%_ } _%>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<%_ if (rootOptions.cssPreprocessor) { _%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
<%# -------------------- IS Using scss OR sass -------------------- -%>
<%- rootOptions.cssPreprocessor
? `<style web lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass') { _%>
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
<style web lang="scss">
</style>
<%- rootOptions.cssPreprocessor
? `<style native lang="${
rootOptions.cssPreprocessor === 'sass'
? 'scss'
: rootOptions.cssPreprocessor
}"` + `>`
: ``
%>
<style native lang="scss">
</style>
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>
<%# -------------------- IS Using stylus -------------------- -%>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "vue-cli-plugin-nativescript-vue",
"version": "0.0.11",
"version": "0.0.12",
"description": "A vue cli 3.x plugin for NativeScript-Vue",
"main": "index.js",
"files": [
"index.js",
"lib",
"generator",
"LICENSE",
"prompts.js"
"prompts.js",
"ui.js",
"logo.png"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down