| | |
| | | const CopyPlugin = require('copy-webpack-plugin'); |
| | | const vuxLoader = require('vux-loader'); |
| | | let env = process.env.NODE_ENV; |
| | | |
| | | //打包地址 |
| | | let srcUrl = '/sib_wx_score/' |
| | | let srcUrl = '/sib_wx_scorem/' |
| | | module.exports = { |
| | | entry: { |
| | | index: "./src/index.js", |
| | |
| | | output: { |
| | | filename: 'js/[name].js', |
| | | path: path.resolve(__dirname, 'dist'), |
| | | publicPath: env ? '/sib_wx_score/' : '/' //根据线上项目路径更改 /projectpath |
| | | publicPath: env ? '/sib_wx_scorem/' : '/' //根据线上项目路径更改 /projectpath |
| | | }, |
| | | /**防止将某些 import 的包(package)打包到 bundle 中,而是在运行时(runtime)再去从外部获取这些扩展依赖, |
| | | * 简而言之:就是使用cdn~不打包这些变量引用的文件,生成环境时需要在index.html中手动引入cdn |
| | |
| | | options: { |
| | | limit: 100000, |
| | | outputPath: 'img/', |
| | | publicPath: `${srcUrl}img` |
| | | //publicPath: `/img` |
| | | // publicPath: `${srcUrl}img` |
| | | publicPath: `/img` |
| | | } |
| | | }] |
| | | }, |
| | |
| | | options: { |
| | | // @vue/babel-preset-jsx vue jsx语法支持 |
| | | presets: ['@babel/preset-env', '@vue/babel-preset-jsx'], |
| | | plugins: ["dynamic-import-webpack"] //import 函数支持,需要安装 |
| | | plugins: ["dynamic-import-webpack"], //import 函数支持,需要安装 |
| | | // plugins: ["@babel/plugin-transform-runtime"] |
| | | } |
| | | } |
| | | }, |