12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- const webpack = require('webpack')
- module.exports = {
- pages: {
- index: {
- // pages 的入口
- entry: 'src/main.js',
- // 模板来源
- template: 'public/index.html',
- // 在 dist/index.html 的输出
- filename: 'index.html',
- // 当使用 title 选项时,
- // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
- title: 'Nginx UI',
- // 在这个页面中包含的块,默认情况下会包含
- // 提取出来的通用 chunk 和 vendor chunk。
- chunks: ['chunk-vendors', 'chunk-common', 'index']
- },
- },
- devServer: {
- proxy: 'https://nginx.jackyu.cn/api'
- },
- productionSourceMap: false,
- css: {
- loaderOptions: {
- css: {},
- postcss: {},
- less: {
- javascriptEnabled: true
- }
- },
- extract: false
- },
- configureWebpack: config => {
- config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
- if (process.env.NODE_ENV === 'production') {
- config.performance = {
- hints: 'warning',
- // 入口起点的最大体积
- maxEntrypointSize: 50000000,
- // 生成文件的最大体积
- maxAssetSize: 30000000,
- // 只给出 js 文件的性能提示
- assetFilter: function (assetFilename) {
- return assetFilename.endsWith('.js')
- }
- }
- }
- },
- chainWebpack: config => {
- config.module
- .rule('vue')
- .use('vue-loader')
- .tap(options => {
- options.compiler = require('vue-template-babel-compiler')
- return options
- })
- }
- }
|