-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwebpack.client.js
52 lines (49 loc) · 1.18 KB
/
webpack.client.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
42
43
44
45
46
47
48
49
50
51
52
const path = require('path');
const webpack = require('webpack');
const pkg = require('./package.json');
const banner = `${pkg.name} client-side script
${pkg.description}\n
@version v${pkg.version}
@author ${pkg.author}
@homepage ${pkg.homepage}
@repository ${pkg.repository.url}`;
const rst = {
mode: 'production',
devtool: 'source-map',
entry: path.join(__dirname, 'src/client.js'),
output: {
filename: 'gcfclient.min.js',
library: 'GcfClient',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
enforce: 'pre',
test: /\.(jsx,js)$/,
exclude: /(node_modules|bower_components|dist)/,
use: 'eslint-loader'
}, {
test: /\.css$/,
use: 'css-loader',
exclude: /(node_modules|bower_components|dist)/
}, {
test: /\.(png|jpg|gif)$/,
use: 'url-loader?limit=10240',
exclude: /(node_modules|bower_components|dist)/
},
{
test: /\.(js)$/,
exclude: /(node_modules|bower_components|dist)/,
use: ['babel-loader']
}
]},
plugins: [
new webpack.ProvidePlugin({
Promise: 'es6-promise'
}),
new webpack.BannerPlugin(banner)
]
}
module.exports = rst;