forked from shprink/ionic-native-transitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dist.min.js
39 lines (37 loc) · 1.24 KB
/
webpack.config.dist.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var path = require('path'),
libPath = path.join(__dirname, 'lib'),
distPath = path.join(__dirname, 'dist'),
webpack = require("webpack"),
pkg = require('./package.json'),
fs = require('fs'),
copyright = fs.readFileSync('./copyright.txt', 'utf8'),
HtmlWebpackPlugin = require('html-webpack-plugin');
copyright = copyright.replace('{pkg.name}', pkg.name)
.replace('{pkg.description}', pkg.description)
.replace('{pkg.version}', pkg.version)
.replace('{pkg.author}', pkg.author)
.replace('{pkg.homepage}', pkg.homepage)
.replace('{pkg.license}', pkg.license);
module.exports = {
entry: path.join(libPath, 'index.js'),
output: {
path: distPath,
library: 'ionicNativeTransitions',
libraryTarget: "umd",
umdNamedDefine: true,
filename: 'ionic-native-transitions.min.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: "ng-annotate?add=true!babel"
}]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.BannerPlugin(copyright)
]
};