forked from williamngan/pts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
45 lines (33 loc) · 1.06 KB
/
webpack.prod.js
File metadata and controls
45 lines (33 loc) · 1.06 KB
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
40
41
42
43
44
45
var webpack = require('webpack');
var path = require('path');
const MinifyPlugin = require("babel-minify-webpack-plugin");
var TARGET = process.env.npm_lifecycle_event
process.env.BABEL_ENV = TARGET
var APP_PATH = path.resolve(__dirname, 'src/_app.ts')
var LIB_PATH = path.resolve(__dirname, 'src/_lib.ts')
var BUILD_PATH = path.resolve(__dirname, 'dist')
var prod = process.argv.indexOf('-p') !== -1
module.exports = {
mode: 'production',
devtool: 'source-map',
entry: {
pts: path.resolve( BUILD_PATH, "pts.js" )
},
output: {
library: 'Pts',
libraryTarget: 'umd',
path: BUILD_PATH,
filename: 'pts.min.js',
globalObject: 'this'
},
devtool: 'source-map',
resolve: {
extensions: ['.js']
},
plugins: [
new MinifyPlugin({}, {
comments: false
}),
new webpack.BannerPlugin( `pts.js ${require("./package.json").version} (minified es6) - Copyright © 2017-${new Date().getFullYear()} William Ngan and contributors.\nLicensed under Apache 2.0 License.\nSee https://github.com/williamngan/pts for details.`)
]
};