Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gimjin/unplugin-remove-vue-style
remove style tag content from vue file. 从vue文件中删除style标签内容。
https://github.com/gimjin/unplugin-remove-vue-style
Last synced: 13 days ago
JSON representation
remove style tag content from vue file. 从vue文件中删除style标签内容。
- Host: GitHub
- URL: https://github.com/gimjin/unplugin-remove-vue-style
- Owner: gimjin
- License: mit
- Created: 2023-02-07T09:25:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-07T13:19:15.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T12:04:10.925Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 199 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
### Why use?
when developing a website, the theme is unique on the website, and there is no need to define styles in each vue file. This can better modify the overall style without losing everything.
It is enough to use atomic CSS (unocss/Windi CSS/...) for local style definition, without thinking about defining class name.
Ignore if developing a library.开发网站时,主题在网站是唯一的,不用在每个vue文件定义样式。这样做能更好的修改整体样式,而不会丢三落四。
局部样式定义用atomic CSS(unocss/Windi CSS/...)已足够,不用思考定义class name。
如果开发库,请忽略。### install
```bash
npm i unplugin-remove-vue-style -D
```### Configuration
##### Vite
```javascript
// vite.config.ts
import { vitePluginRemoveVueStyle } from 'unplugin-remove-vue-style'export default defineConfig({
plugins: [
vitePluginRemoveVueStyle(),
/* ... */
]
})
```
##### Rollup
```javascript
// rollup.config.js
import { rollupPluginRemoveVueStyle } from 'unplugin-remove-vue-style'export default {
plugins: [
rollupPluginRemoveVueStyle(),
/* ... */
]
}
```##### Webpack
```javascript
// webpack.config.js
import { webpackPluginRemoveVueStyle } from 'unplugin-remove-vue-style'module.exports = {
plugins: [
webpackPluginRemoveVueStyle(),
/* ... */
]
}
```##### Esbuild
```javascript
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildPluginRemoveVueStyle } from 'unplugin-remove-vue-style'build({
plugins: [
esbuildPluginRemoveVueStyle(),
/* ... */
]
})
```