2018-08-23 12:18:25 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const webpack = require('webpack');
|
2018-08-23 14:30:21 +00:00
|
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
|
|
|
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
2018-08-23 12:18:25 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2018-08-23 14:30:21 +00:00
|
|
|
mode: 'production',
|
2018-08-23 12:18:25 +00:00
|
|
|
|
|
|
|
context: `${__dirname}/src/`,
|
|
|
|
|
|
|
|
entry: {
|
2018-08-23 14:30:21 +00:00
|
|
|
camera3d: './Camera3DPlugin.js',
|
|
|
|
'camera3d.min': './Camera3DPlugin.js'
|
2018-08-23 12:18:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
2018-08-23 14:30:21 +00:00
|
|
|
path: `${__dirname}/dist/`,
|
2018-08-23 12:18:25 +00:00
|
|
|
filename: '[name].js',
|
2018-08-23 14:30:21 +00:00
|
|
|
library: 'Camera3DPlugin',
|
|
|
|
libraryTarget: 'var'
|
|
|
|
},
|
|
|
|
|
|
|
|
performance: { hints: false },
|
|
|
|
|
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
new UglifyJSPlugin({
|
|
|
|
include: /\.min\.js$/,
|
|
|
|
parallel: true,
|
|
|
|
sourceMap: false,
|
|
|
|
uglifyOptions: {
|
|
|
|
compress: true,
|
|
|
|
ie8: false,
|
|
|
|
ecma: 5,
|
|
|
|
output: {comments: false},
|
|
|
|
warnings: false
|
|
|
|
},
|
|
|
|
warningsFilter: () => false
|
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin([ 'dist' ])
|
|
|
|
]
|
2018-08-23 12:18:25 +00:00
|
|
|
};
|