This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
63 lines (58 loc) · 1.65 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* @since 2016-10-30 11:22
* @author vivaxy
*/
const path = require('path');
const webpack = require('webpack');
const packageJSON = require('./package.json');
const SOURCE_PATH = 'source';
const RELEASE_PATH = 'bundle';
const webpackConfig = {
entry: {
index: `./${SOURCE_PATH}/index.js`,
},
output: {
path: path.resolve(__dirname, `${RELEASE_PATH}`),
filename: 'impression.webpack.js',
library: `Impression`,
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /\.js$/,
exclude: ['node_modules'],
use: {
loader: 'babel-loader',
options: {
presets: [
[
'es2015',
{
modules: false,
},
],
'stage-0',
],
env: {
test: {
plugins: [
'istanbul',
],
},
},
},
},
},
{
test: /\.json$/,
loader: 'json-loader',
},
],
},
plugins: [
// new webpack.optimize.UglifyJsPlugin(),
new webpack.BannerPlugin(`${packageJSON.name}@v${packageJSON.version} by ${packageJSON.author}`),
],
};
module.exports = webpackConfig;