1 Star 0 Fork 43

liulikai/vue-autojs

forked from msdog/vue-autojs 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
vue.config.js 2.00 KB
Copy Edit Raw Blame History
msdog authored 2023-05-10 17:46 . 无服务器使用
var webpack = require('webpack')
// const UglifyPlugin = require('uglifyjs-webpack-plugin')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const { VantResolver } = require('unplugin-vue-components/resolvers')
const ComponentsPlugin = require('unplugin-vue-components/webpack')
let timeStamp = new Date().getTime()
/**
* @type {webpack.Configuration }
*/
module.exports = {
productionSourceMap: false,
publicPath: process.env.NODE_ENV == 'production' ? './' : '/',
devServer: {
open: true,
host: '0.0.0.0',
port: 5666,
openPage: '#/',
before: app => { },
},
css: {
loaderOptions: {
stylus: {
// @/ 是 src/ 的别名,想配的话可以alias上配
import: '~@/assets/style/var.styl',
},
},
extract: { // 打包后css文件名称添加时间戳
filename: `css/[name].${timeStamp}.css`,
chunkFilename: `css/[name].${timeStamp}.css`,
},
},
configureWebpack: {
output: { // 输出重构 打包编译后的js文件名称,添加时间戳.
filename: `js/[name].${timeStamp}.js`,
chunkFilename: `js/[name].${timeStamp}.js`,
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1, // 来限制 chunk 的最大数量
}),
ComponentsPlugin({
resolvers: [VantResolver()],
}),
],
},
chainWebpack: config => {
config.module
.rule('robot')
.test(/robot\..+\.js$/)
.use('raw-loader')
.loader('raw-loader')
.options({
esModule: false,
})
config.module.rule('js').exclude.add(/robot\..+\.js$/)
config.plugin('preload')
.tap(args => {
args[0].fileBlacklist.push(/\.css/, /\.js/)
return args
})
config.plugin('inline-source')
.use(require('html-webpack-inline-source-plugin'))
config
.plugin('html')
.tap(args => {
args[0].title = 'JSON和PHP Array 互转'
args[0].inlineSource = '(\.css|\.js$)'
return args
})
},
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/kaililiu/vue-autojs.git
git@gitee.com:kaililiu/vue-autojs.git
kaililiu
vue-autojs
vue-autojs
html打包进apk-无需服务器

Search