1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const path = require('path');
- const webpackConfigBase = require('./webpack.base.js');
- const merge = require("webpack-merge");
- const webpack = require('webpack');
- const prodConfig = {
- entry: {
- component: './src/index.js'
- },
- devtool:'#source-map',
- plugins:[
- new webpack.DefinePlugin({
- 'process.env': {
- NODE_ENV: '"production"'
- }
- }),
- new webpack.LoaderOptionsPlugin({
- minimize: true
- })
- ],
- externals:{
- vue: "Vue",
- jquery: "jquery",
- moment: "moment",
- 'element-ui': 'ELEMENT'
- },
- output:{
- filename: '[name].bundle.js',
- path: path.resolve('./public/assets/dist/'),
- libraryTarget:'umd',
- library:{
- root: 'cps',
- amd: 'cps',
- commonjs: 'cps',
- },
- libraryExport:'default',
- globalObject:'typeof self !== \'undefined\' ? self : this'
- }
- };
- module.exports = merge(prodConfig, webpackConfigBase);
|