Skip to content

Commit 738ea33

Browse files
committed
Initial commit
0 parents  commit 738ea33

10 files changed

+2249
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Diff for: App.vue

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div>
3+
<p>Hello</p>
4+
5+
<!-- This is a comment -->
6+
<p>World</p>
7+
</div>
8+
</template>
9+
10+
<script>
11+
export default {};
12+
</script>

Diff for: dist/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Document</title><script defer="defer" src="/main.78f2c16d3e664b627fa4.js"></script></head><body></body></html>

Diff for: dist/main.78f2c16d3e664b627fa4.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/main.78f2c16d3e664b627fa4.js.LICENSE.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*! #__NO_SIDE_EFFECTS__ */
2+
3+
/**
4+
* @vue/shared v3.4.27
5+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
6+
* @license MIT
7+
**/

Diff for: index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
10+
</body>
11+
</html>

Diff for: index.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createApp } from 'vue';
2+
3+
import App from './App.vue';
4+
5+
const app = createApp(App);
6+
app.mount('body');

Diff for: package-lock.json

+2,132
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "vue-webpack-test",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "webpack --env production"
8+
},
9+
"type": "module",
10+
"author": "",
11+
"license": "ISC",
12+
"dependencies": {
13+
"clean-webpack-plugin": "^4.0.0",
14+
"html-webpack-plugin": "^5.6.0",
15+
"vue": "^3.4.27",
16+
"vue-loader": "^17.4.2",
17+
"webpack": "^5.91.0",
18+
"webpack-cli": "^5.1.4"
19+
}
20+
}

Diff for: webpack.config.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { CleanWebpackPlugin } from "clean-webpack-plugin";
2+
import HtmlWebpackPlugin from "html-webpack-plugin";
3+
import path from "path";
4+
import { fileURLToPath } from 'url';
5+
import { VueLoaderPlugin } from "vue-loader";
6+
import webpack from "webpack";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
11+
const SRC_DIR = path.resolve(__dirname);
12+
const OUT_DIR = path.resolve(__dirname, 'dist');
13+
14+
export default (env) => {
15+
const mode = env.production == true ? "production" : "development";
16+
const devtool = mode == "production" ? false : "inline-source-map";
17+
18+
return {
19+
mode: mode,
20+
entry: './index.js',
21+
target: 'web',
22+
devtool: devtool,
23+
output: {
24+
filename: '[name].[contenthash].js',
25+
path: OUT_DIR,
26+
publicPath: '/'
27+
},
28+
module: {
29+
rules: [
30+
{
31+
test: /\.vue$/,
32+
loader: 'vue-loader'
33+
},
34+
{
35+
test: /\.(sa|sc|c)ss$/,
36+
use: [
37+
'style-loader',
38+
'css-loader',
39+
'sass-loader',
40+
],
41+
}
42+
],
43+
},
44+
plugins: [
45+
new CleanWebpackPlugin(),
46+
new webpack.DefinePlugin({
47+
__VUE_OPTIONS_API__: false,
48+
__VUE_PROD_DEVTOOLS__: false,
49+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
50+
}),
51+
new HtmlWebpackPlugin({
52+
template: path.resolve(SRC_DIR, 'index.html')
53+
}),
54+
new VueLoaderPlugin()
55+
],
56+
};
57+
};

0 commit comments

Comments
 (0)