-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
62 lines (56 loc) · 1.41 KB
/
webpack.config.js
File metadata and controls
62 lines (56 loc) · 1.41 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Configs file for bundling
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
*/
'use strict';
var pkg = require('./package.json');
var webpack = require('webpack');
var SafeUmdPlugin = require('safe-umd-webpack-plugin');
var isProduction = process.argv.indexOf('-p') > -1;
var FILENAME = pkg.name + (isProduction ? '.min.js' : '.js');
var BANNER = [
FILENAME,
'@version ' + pkg.version,
'@author ' + pkg.author,
'@license ' + pkg.license
].join('\n');
module.exports = {
eslint: {
failOnError: isProduction
},
entry: './src/js/reader.js',
output: {
library: ['tui', 'GestureReader'],
libraryTarget: 'umd',
path: 'dist',
publicPath: 'dist',
filename: FILENAME
},
externals: {
'tui-code-snippet': {
'commonjs': 'tui-code-snippet',
'commonjs2': 'tui-code-snippet',
'amd': 'tui-code-snippet',
'root': ['tui', 'util']
}
},
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /(test|node_modules|bower_components)/,
loader: 'eslint-loader'
}
]
},
plugins: [
new SafeUmdPlugin(),
new webpack.BannerPlugin(BANNER)
],
devServer: {
historyApiFallback: false,
progress: true,
host: '0.0.0.0',
disableHostCheck: true
}
};