-
Notifications
You must be signed in to change notification settings - Fork 10
/
webpack.config.js
41 lines (39 loc) · 1.08 KB
/
webpack.config.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
40
41
const UglifyEsPlugin = require('uglify-es-webpack-plugin');
const webpack = require('webpack');
const libraryName = 'vue-terminal-ui';
const buildTarget = process.env.TARGET === 'window' ? 'window' : 'umd';
const outputFile = `${libraryName}-${buildTarget}.js`;
module.exports = {
entry: './index.js',
output: {
path: __dirname,
filename: 'dist/vue-terminal-ui.js',
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue-loader'
},{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['latest']
}
}]
},
output: {
path: __dirname + '/dist',
filename: outputFile,
library: libraryName,
libraryTarget: buildTarget,
umdNamedDefine: true
},
plugins: [
new UglifyEsPlugin(),
new webpack.BannerPlugin({
banner: "Vue.js Terminal UI emulator \n https://github.com/shershen08/vue-terminal-ui/ \n file:[file]"
})
]
}