Skip to content

Commit 02d001c

Browse files
committed
chore: added play with webpack
1 parent dbd1308 commit 02d001c

File tree

11 files changed

+4877
-157
lines changed

11 files changed

+4877
-157
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"play:vite:build": "pnpm run --filter @unplugin-vue-cssvars/play-vite build",
6363
"play:vite:server": "pnpm run --filter @unplugin-vue-cssvars/play-vite dev",
6464
"play:vite:preview": "pnpm run --filter @unplugin-vue-cssvars/play-vite preview",
65+
"play:webpack:build": "pnpm run --filter @unplugin-vue-cssvars/play-webpack build",
66+
"play:webpack:server": "pnpm run --filter @unplugin-vue-cssvars/play-webpack dev",
6567
"release": "bumpp package.json --commit --push --tag",
6668
"clean": "rimraf dist",
6769
"prepare": "npx simple-git-hooks",
@@ -109,6 +111,7 @@
109111
"@unplugin-vue-cssvars/core": "workspace:*",
110112
"@unplugin-vue-cssvars/entry": "workspace:*",
111113
"@unplugin-vue-cssvars/play-vite": "workspace:*",
114+
"@unplugin-vue-cssvars/play-webpack": "workspace:*",
112115
"@unplugin-vue-cssvars/utils": "workspace:*",
113116
"@vitejs/plugin-vue": "^4.1.0",
114117
"@vitejs/plugin-vue-jsx": "^3.0.1",

play/webpack/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset',
4+
],
5+
}

play/webpack/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@unplugin-vue-cssvars/play-webpack",
3+
"private": true,
4+
"version": "0.1.0",
5+
"scripts": {
6+
"dev": "vue-cli-service serve",
7+
"build": "vue-cli-service build"
8+
},
9+
"dependencies": {
10+
"core-js": "^3.8.3"
11+
},
12+
"devDependencies": {
13+
"@vue/cli-plugin-babel": "~5.0.0",
14+
"@vue/cli-plugin-typescript": "~5.0.0",
15+
"@vue/cli-service": "~5.0.0"
16+
},
17+
"browserslist": [
18+
"> 1%",
19+
"last 2 versions",
20+
"not dead",
21+
"not ie 11"
22+
]
23+
}

play/webpack/public/favicon.ico

4.19 KB
Binary file not shown.

play/webpack/public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

play/webpack/src/App.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<template>
2+
<p>ttttt</p>
3+
</template>
4+
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+
}
22+
</style>

play/webpack/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
4+
createApp(App).mount('#app')

play/webpack/src/shims-vue.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
declare module '*.vue' {
3+
import type { DefineComponent } from 'vue'
4+
const component: DefineComponent<{}, {}, any>
5+
export default component
6+
}

play/webpack/tsconfig.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"module": "esnext",
5+
"strict": true,
6+
"jsx": "preserve",
7+
"moduleResolution": "node",
8+
"skipLibCheck": true,
9+
"esModuleInterop": true,
10+
"allowSyntheticDefaultImports": true,
11+
"forceConsistentCasingInFileNames": true,
12+
"useDefineForClassFields": true,
13+
"sourceMap": true,
14+
"baseUrl": ".",
15+
"types": [
16+
"webpack-env"
17+
],
18+
"paths": {
19+
"@/*": [
20+
"src/*"
21+
]
22+
},
23+
"lib": [
24+
"esnext",
25+
"dom",
26+
"dom.iterable",
27+
"scripthost"
28+
]
29+
},
30+
"include": [
31+
"src/**/*.ts",
32+
"src/**/*.tsx",
33+
"src/**/*.vue",
34+
"tests/**/*.ts",
35+
"tests/**/*.tsx"
36+
],
37+
"exclude": [
38+
"node_modules"
39+
]
40+
}

play/webpack/vue.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { defineConfig } = require('@vue/cli-service')
2+
module.exports = defineConfig({
3+
transpileDependencies: true,
4+
})

0 commit comments

Comments
 (0)