Skip to content

Commit 1cd8d79

Browse files
committed
chore: update paly webpack
1 parent a8e5f3e commit 1cd8d79

File tree

6 files changed

+58
-18
lines changed

6 files changed

+58
-18
lines changed

.idea/unplugin-vue-cssvars.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

play/webpack/src/App.vue

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1+
<script setup lang="ts">
2+
import { reactive, ref } from 'vue'
3+
import Comp from '../../comp.vue'
4+
const color = ref('blue')
5+
const appAsd = () => 'red'
6+
const fooColor = appAsd()
7+
</script>
8+
19
<template>
2-
<p>ttttt</p>
10+
<div id="foo" class="scss">
11+
app
12+
</div>
313
</template>
414

5-
<script lang="ts">
6-
import { defineComponent } from 'vue'
7-
8-
export default defineComponent({
9-
name: 'App',
10-
})
11-
</script>
12-
13-
<style>
14-
#app {
15-
font-family: Avenir, Helvetica, Arial, sans-serif;
16-
-webkit-font-smoothing: antialiased;
17-
-moz-osx-font-smoothing: grayscale;
18-
text-align: center;
19-
color: #2c3e50;
20-
margin-top: 60px;
21-
}
15+
<style scoped>
16+
@import '@/assets/css/foo.css';
2217
</style>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#foo{
2+
color: v-bind-m(color);
3+
background: #ffebf8;
4+
width: 200px;
5+
height: 30px;
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import "test2.css";
2+
3+
/** test.css **/
4+
p {
5+
color: v-bind(color);
6+
}
7+
/*.test {
8+
color: red;
9+
}
10+
.test .test_t {
11+
color: v-bind(font);
12+
}
13+
.test>.test_t {
14+
color: v-bind(font);
15+
}*/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@import "test.css";
2+
/*
3+
存在相同样式(test.css),会以先出现的那个优先
4+
*/
5+
/*div {
6+
color: v-bind(appTheme2);
7+
}*/
8+
.test {
9+
color: v-bind(appTheme2);
10+
}

play/webpack/vue.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
const { resolve } = require('path')
12
const { defineConfig } = require('@vue/cli-service')
3+
const { webpackVueCSSVars } = require('../../dist/index.cjs')
24
module.exports = defineConfig({
35
transpileDependencies: true,
6+
configureWebpack: {
7+
plugins: [
8+
webpackVueCSSVars({
9+
include: [/.vue/],
10+
includeCompile: ['**/**.scss', '**/**.css'],
11+
alias: {
12+
'@': resolve(__dirname, './src'),
13+
},
14+
}),
15+
],
16+
},
417
})

0 commit comments

Comments
 (0)