feat:first commit
This commit is contained in:
39
vue.config.js
Normal file
39
vue.config.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const TransformPages = require('uni-read-pages')
|
||||
const ESLintPlugin = require('eslint-webpack-plugin')
|
||||
const { webpack } = new TransformPages()
|
||||
const path = require('path')
|
||||
|
||||
const resolve = (dir) => {
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
module.exports = {
|
||||
publicPath: process.env.VUE_APP_PUBLIC_PATH || '/',
|
||||
devServer: {
|
||||
hot: true,
|
||||
port: 8088
|
||||
},
|
||||
transpileDependencies: ['@dcloudio/uni-ui', 'uni-simple-router', '/node_modules/uni-simple-router'],
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
|
||||
const tfPages = new TransformPages({
|
||||
includes: ['path', 'name', 'aliasPath', 'needLogin']
|
||||
})
|
||||
return JSON.stringify(tfPages.routes)
|
||||
}, true)
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
fix: true,
|
||||
emitError: true,
|
||||
emitWarning: true
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('src'),
|
||||
'@/static': resolve('static')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user