-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
46 lines (45 loc) · 1.45 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
if (process.env.NODE_ENV === 'development') {
process.env.TAILWIND_MODE = 'watch'
}
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
const { UniAppWeappTailwindcssWebpackPluginV4 } = require('weapp-tailwindcss-webpack-plugin')
/**
* @type {import('@vue/cli-service').ProjectOptions}
*/
const config = {
//....
configureWebpack: {
plugins: [
new UniAppWeappTailwindcssWebpackPluginV4({
disabled: false,
}),
],
},
chainWebpack: config => {
config.module
.rule('vue')
.use('webpack-in-loader')
.loader(require.resolve('./node_modules/webpack-in-loader/index.js'))
.tap(options => {
options = {
localeFile: path.join(require.resolve('./locale/zh.js')), // 与cli中相同,若生成的时候保持默认,则不需要配置
}
return options
})
config.module
.rule('js')
.use('webpack-in-loader')
.loader(require.resolve('./node_modules/webpack-in-loader/index.js'))
.tap(options => {
options = {
localeFile: path.join(require.resolve('./locale/zh.js')), // 与cli中相同,若生成的时候保持默认,则不需要配置
}
return options
})
},
//....
}
module.exports = config