This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add `unplugin-auto-import@^0.17.3
- Loading branch information
Showing
12 changed files
with
943 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"compilerOptions": {}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ module.exports = defineConfig({ | |
disableTransformByDefault: true | ||
} | ||
} | ||
});; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Vue</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "@rspack-compat/rspack-unplugin_1.6", | ||
"scripts": { | ||
"build": "rspack build" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.4.19" | ||
}, | ||
"devDependencies": { | ||
"@rspack/cli": "0.4.1", | ||
"@rspack/core": "0.4.1", | ||
"unplugin-auto-import": "^0.17.3", | ||
"html-webpack-plugin": "5.6.0", | ||
"vue-loader": "^17.4.2" | ||
}, | ||
"rspack": { | ||
"version": ">=0.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { defineConfig } = require('@rspack/cli') | ||
const { VueLoaderPlugin } = require("vue-loader"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const AutoImport = require("unplugin-auto-import/rspack").default; | ||
|
||
module.exports = defineConfig({ | ||
plugins: [ | ||
AutoImport({ | ||
imports: ["vue"], | ||
}), | ||
new VueLoaderPlugin(), | ||
// the aims of `HtmlWebpackPlugin` is ensure | ||
// `unplugin-auto-import` will not includes `index.html` | ||
new HtmlWebpackPlugin({ | ||
template: "./index.html", | ||
}), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: "vue-loader", | ||
options: { | ||
experimentalInlineMatchResource: true, | ||
}, | ||
} | ||
], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script setup> | ||
import HelloWorld from "./HelloWorld.vue"; | ||
const title = ref("Rspack + Vue"); | ||
</script> | ||
|
||
<template> | ||
<HelloWorld :msg="title" /> | ||
</template> | ||
|
||
<style scoped> | ||
.logo { | ||
height: 6em; | ||
padding: 1.5em; | ||
will-change: filter; | ||
transition: filter 300ms; | ||
} | ||
.logo:hover { | ||
filter: drop-shadow(0 0 2em #646cffaa); | ||
} | ||
.logo.vue:hover { | ||
filter: drop-shadow(0 0 2em #42b883aa); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup> | ||
import { ref } from "vue"; | ||
defineProps({ | ||
msg: { | ||
type: String, | ||
} | ||
}) | ||
const count = ref(0); | ||
</script> | ||
|
||
<template> | ||
<h1>{{ msg }}</h1> | ||
|
||
<div class="card"> | ||
<button type="button" @click="count++">count is {{ count }}</button> | ||
<p> | ||
Edit | ||
<code>HelloWorld.vue</code> to test HMR | ||
</p> | ||
</div> | ||
|
||
<p> | ||
Check out Rspack which support Vue | ||
</p> | ||
<p> | ||
Install | ||
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a> | ||
in your IDE for a better DX | ||
</p> | ||
</template> | ||
|
||
<style scoped> | ||
.read-the-docs { | ||
color: #888; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createApp } from "vue"; | ||
import App from "./App.vue"; | ||
|
||
createApp(App).mount("#app"); |
Oops, something went wrong.