Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 18, 2022
1 parent bf990fc commit 8ae5955
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions examples/webpack4/babel.config.js
@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
'@vue/cli-plugin-babel/preset',
],
}
18 changes: 10 additions & 8 deletions examples/webpack4/src/App.vue
@@ -1,19 +1,21 @@
<template>
<div flex id="app" class="w-77px">
<About />
<Home />
</div>
</template>
<script>
import About from './About.vue'
import Home from './Home.vue'
export default {
components: {
About,
Home
}
Home,
},
}
</script>

<template>
<div id="app" flex class="w-77px">
<About />
<Home />
</div>
</template>

<style>
</style>
16 changes: 9 additions & 7 deletions examples/webpack4/src/Home.vue
@@ -1,14 +1,16 @@
<template>
<div class="home">
<div class="w-200px bg-red h-100px">HOME</div>
</div>
</template>

<script>
// @ is an alias to /src
export default {
name: 'Home',
}
</script>

<template>
<div class="home">
<div class="w-200px bg-red h-100px">
HOME
</div>
</div>
</template>
2 changes: 1 addition & 1 deletion examples/webpack4/src/main.js
Expand Up @@ -4,5 +4,5 @@ import App from './App.vue'
import 'uno.css'

new Vue({
render: h => h(App)
render: h => h(App),
}).$mount('#app')
7 changes: 4 additions & 3 deletions examples/webpack4/unocss.config.js
@@ -1,9 +1,10 @@
import presetAttributify from '@unocss/preset-attributify'
import presetUno from '@unocss/preset-uno'
import { defineConfig } from '@unocss/config'

module.exports = {
export default defineConfig({
presets: [
presetAttributify(),
presetUno(),
]
}
],
})
2 changes: 1 addition & 1 deletion examples/webpack4/vue.config.js
Expand Up @@ -13,4 +13,4 @@ module.exports = {
cache: false,
})
},
}
}
5 changes: 4 additions & 1 deletion packages/webpack/src/index.ts
Expand Up @@ -97,7 +97,10 @@ export default function WebpackPlugin<Theme extends {}>(
const result = await uno.generate(tokens, { minify: true })

for (const file of files) {
if (file === '*') return;
// https://github.com/unocss/unocss/pull/1428
if (file === '*')
return

let code = compilation.assets[file].source().toString()
let replaced = false
code = code.replace(HASH_PLACEHOLDER_RE, '')
Expand Down

0 comments on commit 8ae5955

Please sign in to comment.