Skip to content

Commit

Permalink
sprintfix: 国际化翻译校正 & vue升级至2.7.x (closed #1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
GONGONGONG authored and ZhuoZhuoCrayon committed Jul 12, 2023
1 parent 415cf66 commit a8a29a8
Show file tree
Hide file tree
Showing 36 changed files with 2,038 additions and 659 deletions.
9 changes: 8 additions & 1 deletion frontend/build/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
"node_modules"
],
"include": [
"./*.ts"
"./*.ts",
"src/**/*.js", //src为本地开发目录
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
],
"vueCompilerOptions": {
"target": 2.7
},
"compilerOptions": {
"esModuleInterop": true,
// 启用装饰器
Expand Down
10 changes: 10 additions & 0 deletions frontend/build/webpack.base.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ProgressBarPlugin from 'progress-bar-webpack-plugin'
import VueLoaderPlugin from 'vue-loader/lib/plugin'
import chalk from 'chalk'
import os from 'os'
import NodePolyfillPlugin from "node-polyfill-webpack-plugin"

const isProd = process.env.NODE_ENV === 'production'

Expand All @@ -32,6 +33,10 @@ const baseConfig: webpack.Configuration = {
vue$: 'vue/dist/vue.esm.js',
'@': resolve('src'),
'@static': resolve('static'),
},
fallback: {
fs: false,
crypto: require.resolve("crypto-browserify")
}
},

Expand All @@ -57,6 +62,10 @@ const baseConfig: webpack.Configuration = {
use: {
loader: 'vue-loader',
options: {
loaders: {
ts: 'ts-loader',
tsx: 'babel-loader!ts-loader',
},
transformAssetUrls: {
video: 'src',
source: 'src',
Expand Down Expand Up @@ -161,6 +170,7 @@ const baseConfig: webpack.Configuration = {
},

plugins: [
new NodePolyfillPlugin(),
new VueLoaderPlugin(),
// moment 优化,只提取本地包
new webpack.ContextReplacementPlugin(/moment\/locale$/, /zh-cn/),
Expand Down
9 changes: 5 additions & 4 deletions frontend/build/webpack.dev.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ const webpackConfig = merge(baseConf, {
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1
}
// options: {
// importLoaders: 2
// }
},
{
loader: 'postcss-loader',
options: {
// importLoaders: 2,
postcssOptions: {
config: path.resolve(__dirname, '..', 'postcss.config.js')
}
Expand All @@ -146,7 +147,7 @@ const webpackConfig = merge(baseConf, {
{
loader: 'css-loader',
options: {
importLoaders: 1
// importLoaders: 1
}
},
// Compiles Sass to CSS
Expand Down
13 changes: 7 additions & 6 deletions frontend/build/webpack.prod.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ const prodConf = merge(baseConf, {
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 1
}
// 升级vue2.7时被注释
// options: {
// importLoaders: 1
// }
},
{
loader: 'postcss-loader',
Expand All @@ -136,9 +137,9 @@ const prodConf = merge(baseConf, {
// Translates CSS into CommonJS
{
loader: 'css-loader',
options: {
importLoaders: 1
}
// options: {
// importLoaders: 1
// }
},
// Compiles Sass to CSS
'sass-loader'
Expand Down
Loading

0 comments on commit a8a29a8

Please sign in to comment.