Closed countingSta closed 5 years ago
@countingSta 不要在publicPath 上面配置cdn这个,另外 process.env.NODE_ENV === 'production' 判断, process.env.NODE_ENV 这个值 你是否有设置? CDN 配置: https://www.yuque.com/easy-team/easywebpack/cdn
optimize-css-assets-webpack-plugin 已内置,并开启了,无需配置
const VueLoaderPlugin = require('vue-loader/lib/plugin'); 引入这个有什么特殊要求? easywebpack-vue 已经整合了相关插件,从目前使用来看,无需配置其他插件。
目前 easywebpack 内置方案是 vue-loader 版本是 14,无需相关插件配置。 15 还需要等一段时间
已内置 15
'use strict'; const path = require('path'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); const optimizeCssAssets = require('optimize-css-assets-webpack-plugin'); const Oss = require('./plugins/oss');
module.exports = { egg: true, framework: 'vue', entry: { include: ['app/web/page'], exclude: ['app/web/page/[a-z]+/(component|store)'], loader: { client: 'app/web/framework/vue/entry/client-loader.ts', server: 'app/web/framework/vue/entry/server-loader.ts' } }, // publicPath: process.env.NODE_ENV === 'production' ? 'https://cdn.dooprime.com/clearing-website/dist/' : '/public/', alias: { server: 'app/web/framework/vue/entry/server.ts', client: 'app/web/framework/vue/entry/client.ts', component: 'app/web/component', framework: 'app/web/framework', }, dll: ['vue'], loaders: { typescript: true, less: true, stylus: true }, plugins: { vueLoader: { name: new VueLoaderPlugin() }, optimizeCssAssets: { name: new optimizeCssAssets(), env: ['prod'] } } };