切换导航条
切换导航条
当前项目
正在载入...
登录
术习电报
/
electron-vue-template
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
作者
umbrella22
2020-06-22 13:16:21 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
提交
79c29fe9ed91e634c139a52dffdcb146f5704df9
79c29fe9
1 个父辈
b49c74f8
修改web打包时的问题
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
3 行删除
.electron-vue/webpack.web.config.js
.electron-vue/webpack.web.config.js
查看文件 @
79c29fe
...
...
@@ -11,6 +11,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
const
TerserPlugin
=
require
(
'terser-webpack-plugin'
);
const
{
VueLoaderPlugin
}
=
require
(
'vue-loader'
)
const
HappyPack
=
require
(
'happypack'
)
const
HappyThreadPool
=
HappyPack
.
ThreadPool
({
size
:
os
.
cpus
().
length
})
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
'..'
,
dir
)
...
...
@@ -56,7 +58,7 @@ let webConfig = {
},
{
test
:
/
\.
js$/
,
use
:
'
babel-loader
'
,
use
:
'
happypack/loader?id=HappyRendererBabel
'
,
include
:
[
resolve
(
'src/renderer'
)],
exclude
:
/node_modules/
},
...
...
@@ -65,7 +67,11 @@ let webConfig = {
use
:
{
loader
:
'vue-loader'
,
options
:
{
extractCSS
:
true
,
loader
:
'vue-loader'
,
options
:
{
cacheDirectory
:
'node_modules/.cache/vue-loader'
,
cacheIdentifier
:
'7270960a'
,
extractCSS
:
process
.
env
.
NODE_ENV
===
'production'
,
loaders
:
{
sass
:
'vue-style-loader!css-loader!sass-loader?indentedSyntax=1'
,
scss
:
'vue-style-loader!css-loader!sass-loader'
,
...
...
@@ -73,6 +79,7 @@ let webConfig = {
}
}
}
}
},
{
test
:
/
\.
svg$/
,
...
...
@@ -124,7 +131,17 @@ let webConfig = {
'process.env.IS_WEB'
:
'true'
}),
new
webpack
.
HotModuleReplacementPlugin
(),
new
webpack
.
NoEmitOnErrorsPlugin
()
new
webpack
.
NoEmitOnErrorsPlugin
(),
new
HappyPack
({
id
:
'HappyRendererBabel'
,
loaders
:
[{
loader
:
'babel-loader'
,
options
:
{
cacheDirectory
:
true
}
}],
threadPool
:
HappyThreadPool
}),
],
output
:
{
filename
:
'[name].js'
,
...
...
@@ -195,6 +212,14 @@ if (process.env.NODE_ENV === 'production') {
terserOptions
:
{
warnings
:
false
,
compress
:
{
hoist_funs
:
false
,
hoist_props
:
false
,
hoist_vars
:
false
,
inline
:
false
,
loops
:
false
,
dead_code
:
true
,
booleans
:
true
,
if_return
:
true
,
warnings
:
false
,
drop_console
:
true
,
drop_debugger
:
true
,
...
...
请
注册
或
登录
后发表评论