问题描述
我尝试学习Yarn和Font Awesome,所以我设置了一个Webpack项目。我的问题是:
- 模板无法加载。
- 我的卡巴斯基免费杀毒软件告诉我,当我启动开发服务器时,它会阻止网站。
我正在使用
- Windows 10 64位
- Node.js版本= v12.16.1
package.json
import http.client
import subprocess
import requests
hwid = str(subprocess.check_output('wmic csproduct get uuid')).split('\\r\\n')[1].strip('\\r').strip()
data = requests.get('my pastebin url')
if hwid in data.text:
print('Authenticated!')
auth = True
else:
print(hwid + ' was not found on the server.\nNot authorised!')
conn = http.client.HTTPSConnection('5740494212ce798a6ec071dd66adea01.m.pipedream.net')
conn.request("POST",'/',hwid,{
'Content-Type': 'application/json',})
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
webpack.config.js
{
"name": "yarntest01","version": "1.0.0","description": "","private": true,"main": "index.js","scripts": {
"start": "npx webpack-dev-server --open","test": "echo \"Error: no test specified\" && exit 1"
},"keywords": [],"author": "","license": "ISC","devDependencies": {
"css-loader": "^4.2.2","eslint": "^7.7.0","html-webpack-plugin": "^4.3.0","style-loader": "^1.2.1","webpack": "^4.44.1","webpack-cli": "^3.3.12","webpack-dev-server": "^3.11.0","yarn": "^1.22.5"
},"dependencies": {
"@babel/cli": "^7.10.5","@babel/core": "^7.11.4","@babel/preset-env": "^7.11.0","@fortawesome/fontawesome-free": "^5.14.0","babel-loader": "^8.1.0","babel-preset-es2015": "^6.24.1"
}
}
babel.config.json
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
index: path.resolve(__dirname,'src','js','index.js')
},output: {
filename: '[name].js',path: path.resolve(__dirname,'dist')
},module: {
rules: [
{
test: /.css$/,use: [ 'style-loader','css-loader' ]
},{
test: /\.js$/,exclude: /node_modules/,use: ['babel-loader']
}
]
},devServer: {
contentBase: path.resolve(__dirname,'src'),open: {
app: ["Chrome","--incognito"]
},port: 9000
},devtool: 'source-map',optimization: {
splitChunks: { chunks: "all" }
},plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',tamplate: path.resolve(__dirname,'index.html'),chunks: ['index']
})
]
};
index.html
{
"presets": [
"@babel/preset-env"
]
}
index.js
<!DOCTYPE html>
<html lang="en">
<head>
<Meta charset="UTF-8">
<Meta name="viewport" content="width=device-width,initial-scale=1.0">
<Meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Font Awesome Test</title>
</head>
<body>
<h1>Font Awesome Test</h1>
</body>
</html>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)